2023-01-21 01:31:34 +01:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Partial: Latest Stories Compact
|
|
|
|
*
|
|
|
|
* Renders the (buffered) HTML for the [fictioneer_latest_stories type="compact"] shortcode.
|
|
|
|
*
|
|
|
|
* @package WordPress
|
|
|
|
* @subpackage Fictioneer
|
2024-01-26 17:45:59 +01:00
|
|
|
* @since 4.0.0
|
2023-09-17 18:21:46 +02:00
|
|
|
* @see fictioneer_clause_sticky_stories()
|
2023-01-21 01:31:34 +01:00
|
|
|
*
|
2024-11-26 12:11:30 +01:00
|
|
|
* @internal $args['uid'] Unique ID of the shortcode. Pattern: shortcode-id-{id}.
|
|
|
|
* @internal $args['type'] Type argument passed from shortcode ('compact').
|
|
|
|
* @internal $args['count'] Number of posts provided by the shortcode.
|
|
|
|
* @internal $args['author'] Author provided by the shortcode.
|
|
|
|
* @internal $args['order'] Order of posts. Default 'DESC'.
|
|
|
|
* @internal $args['orderby'] Sorting of posts. Default 'date'.
|
|
|
|
* @internal $args['post_ids'] Array of post IDs. Default empty.
|
2025-01-12 17:44:38 +01:00
|
|
|
* @internal $args['post_status'] Queried post status. Default 'publish'.
|
2024-11-26 12:11:30 +01:00
|
|
|
* @internal $args['author_ids'] Array of author IDs. Default empty.
|
|
|
|
* @internal $args['excluded_authors'] Array of author IDs to exclude. Default empty.
|
|
|
|
* @internal $args['excluded_cats'] Array of category IDs to exclude. Default empty.
|
|
|
|
* @internal $args['excluded_tags'] Array of tag IDs to exclude. Default empty.
|
|
|
|
* @internal $args['ignore_protected'] Whether to ignore protected posts. Default false.
|
|
|
|
* @internal $args['only_protected'] Whether to query only protected posts. Default false.
|
|
|
|
* @internal $args['taxonomies'] Array of taxonomy arrays. Default empty.
|
|
|
|
* @internal $args['relation'] Relationship between taxonomies.
|
|
|
|
* @internal $args['source'] Whether to show the author. Default true.
|
|
|
|
* @internal $args['vertical'] Whether to show the vertical variant.
|
|
|
|
* @internal $args['seamless'] Whether to render the image seamless. Default false (Customizer).
|
|
|
|
* @internal $args['aspect_ratio'] Aspect ratio for the image. Only with vertical.
|
|
|
|
* @internal $args['lightbox'] Whether the image is opened in the lightbox. Default true.
|
|
|
|
* @internal $args['thumbnail'] Whether the image is rendered. Default true (Customizer).
|
|
|
|
* @internal $args['classes'] String of additional CSS classes. Default empty.
|
|
|
|
* @internal $args['infobox'] Whether to show the info box and toggle. Default true.
|
|
|
|
* @internal $args['terms'] Either inline, pills, none, or false. Default inline.
|
|
|
|
* @internal $args['max_terms'] Maximum number of shown taxonomies. Default 10.
|
|
|
|
* @internal $args['footer_chapters'] Whether to show the chapter count. Default true.
|
|
|
|
* @internal $args['footer_words'] Whether to show the word count. Default true.
|
|
|
|
* @internal $args['footer_date'] Whether to show the date. Default true.
|
|
|
|
* @internal $args['footer_status'] Whether to show the status. Default true.
|
|
|
|
* @internal $args['footer_rating'] Whether to show the age rating. Default true.
|
|
|
|
* @internal $args['footer_comments'] Whether to show the post comment count. Default false.
|
|
|
|
* @internal $args['splide'] Configuration JSON for the Splide slider. Default empty.
|
2023-01-21 01:31:34 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
2023-08-20 20:21:48 +02:00
|
|
|
// No direct access!
|
|
|
|
defined( 'ABSPATH' ) OR exit;
|
|
|
|
|
2023-06-09 02:06:45 +02:00
|
|
|
// Setup
|
2024-09-06 01:26:42 +02:00
|
|
|
$splide = $args['splide'] ?? 0;
|
2024-08-23 23:12:24 +02:00
|
|
|
$show_terms = ! in_array( $args['terms'], ['none', 'false'] ) &&
|
|
|
|
! get_option( 'fictioneer_hide_taxonomies_on_story_cards' );
|
2023-06-09 02:06:45 +02:00
|
|
|
|
2023-01-21 01:31:34 +01:00
|
|
|
// Prepare query
|
|
|
|
$query_args = array(
|
2023-09-15 14:00:44 +02:00
|
|
|
'fictioneer_query_name' => 'latest_stories_compact',
|
2023-03-08 13:22:04 +01:00
|
|
|
'post_type' => 'fcn_story',
|
2025-01-12 18:00:18 +01:00
|
|
|
'post_status' => $args['post_status'],
|
2023-08-17 01:32:02 +02:00
|
|
|
'post__in' => $args['post_ids'], // May be empty!
|
2023-09-16 13:10:52 +02:00
|
|
|
'order' => $args['order'],
|
2023-08-07 12:07:48 +02:00
|
|
|
'orderby' => $args['orderby'],
|
2023-01-21 01:31:34 +01:00
|
|
|
'posts_per_page' => $args['count'],
|
2024-08-23 23:12:24 +02:00
|
|
|
'update_post_term_cache' => $show_terms, // Improve performance
|
2024-01-28 18:59:23 +01:00
|
|
|
'no_found_rows' => true
|
|
|
|
);
|
|
|
|
|
|
|
|
// Use extended meta query?
|
2024-01-28 19:55:54 +01:00
|
|
|
if ( get_option( 'fictioneer_disable_extended_story_list_meta_queries' ) ) {
|
2024-01-28 20:45:32 +01:00
|
|
|
$query_args['meta_key'] = 'fictioneer_story_hidden';
|
|
|
|
$query_args['meta_value'] = '0';
|
2024-01-28 18:59:23 +01:00
|
|
|
} else {
|
|
|
|
$query_args['meta_query'] = array(
|
2024-01-28 19:55:54 +01:00
|
|
|
'relation' => 'OR',
|
2024-01-28 18:59:23 +01:00
|
|
|
array(
|
|
|
|
'key' => 'fictioneer_story_hidden',
|
|
|
|
'value' => '0'
|
2024-01-28 19:55:54 +01:00
|
|
|
),
|
|
|
|
array(
|
|
|
|
'key' => 'fictioneer_story_hidden',
|
|
|
|
'compare' => 'NOT EXISTS'
|
2024-01-28 18:59:23 +01:00
|
|
|
)
|
|
|
|
);
|
|
|
|
}
|
2023-01-21 01:31:34 +01:00
|
|
|
|
2023-09-16 22:59:43 +02:00
|
|
|
// Author?
|
2023-09-17 01:28:14 +02:00
|
|
|
if ( ! empty( $args['author'] ) ) {
|
2023-09-10 18:36:12 +02:00
|
|
|
$query_args['author_name'] = $args['author'];
|
|
|
|
}
|
2023-01-21 01:31:34 +01:00
|
|
|
|
2023-09-16 22:59:43 +02:00
|
|
|
// Author IDs?
|
|
|
|
if ( ! empty( $args['author_ids'] ) ) {
|
|
|
|
$query_args['author__in'] = $args['author_ids'];
|
|
|
|
}
|
|
|
|
|
2023-03-08 13:22:04 +01:00
|
|
|
// Taxonomies?
|
|
|
|
if ( ! empty( $args['taxonomies'] ) ) {
|
2023-03-08 23:24:41 +01:00
|
|
|
$query_args['tax_query'] = fictioneer_get_shortcode_tax_query( $args );
|
2023-03-08 13:22:04 +01:00
|
|
|
}
|
|
|
|
|
2023-03-10 16:35:47 +01:00
|
|
|
// Excluded tags?
|
|
|
|
if ( ! empty( $args['excluded_tags'] ) ) {
|
|
|
|
$query_args['tag__not_in'] = $args['excluded_tags'];
|
|
|
|
}
|
|
|
|
|
|
|
|
// Excluded categories?
|
|
|
|
if ( ! empty( $args['excluded_cats'] ) ) {
|
|
|
|
$query_args['category__not_in'] = $args['excluded_cats'];
|
|
|
|
}
|
|
|
|
|
2023-09-16 22:59:43 +02:00
|
|
|
// Excluded authors?
|
|
|
|
if ( ! empty( $args['excluded_authors'] ) ) {
|
|
|
|
$query_args['author__not_in'] = $args['excluded_authors'];
|
|
|
|
}
|
|
|
|
|
2023-09-15 15:15:45 +02:00
|
|
|
// Ignore protected?
|
|
|
|
if ( $args['ignore_protected'] ) {
|
2024-09-20 23:32:29 +02:00
|
|
|
$query_args['has_password'] = false;
|
2023-09-15 15:15:45 +02:00
|
|
|
}
|
|
|
|
|
2024-09-20 23:41:37 +02:00
|
|
|
// Only protected?
|
|
|
|
if ( $args['only_protected'] ) {
|
|
|
|
$query_args['has_password'] = true;
|
|
|
|
}
|
|
|
|
|
2023-03-08 13:22:04 +01:00
|
|
|
// Apply filters
|
2023-03-10 15:20:48 +01:00
|
|
|
$query_args = apply_filters( 'fictioneer_filter_shortcode_latest_stories_query_args', $query_args, $args );
|
2023-03-08 13:22:04 +01:00
|
|
|
|
2023-01-21 01:31:34 +01:00
|
|
|
// Query stories
|
2023-08-03 13:17:32 +02:00
|
|
|
$entries = fictioneer_shortcode_query( $query_args );
|
2023-01-21 01:31:34 +01:00
|
|
|
|
2024-09-06 01:26:42 +02:00
|
|
|
// Extra attributes
|
|
|
|
$attributes = [];
|
2023-01-21 01:31:34 +01:00
|
|
|
|
2024-09-06 01:26:42 +02:00
|
|
|
if ( $splide ) {
|
|
|
|
$attributes[] = "data-splide='{$splide}'";
|
|
|
|
}
|
2023-01-21 01:31:34 +01:00
|
|
|
|
2024-09-06 01:26:42 +02:00
|
|
|
?>
|
2023-01-21 01:31:34 +01:00
|
|
|
|
2024-09-06 01:26:42 +02:00
|
|
|
<section class="small-card-block latest-stories _compact <?php echo $args['classes']; ?>" <?php echo implode( ' ', $attributes ); ?>>
|
|
|
|
<?php
|
|
|
|
if ( $args['splide'] === false ) {
|
|
|
|
echo '<div class="shortcode-json-invalid">' . __( 'Splide JSON is invalid and has been ignored.', 'fictioneer' ) . '</div>';
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( $splide ) {
|
2024-10-07 19:47:35 +02:00
|
|
|
echo fictioneer_get_splide_loading_style( $splide, $args['uid'] );
|
|
|
|
echo fictioneer_get_splide_placeholders( $args['uid'] );
|
2024-09-06 01:26:42 +02:00
|
|
|
echo '<div class="splide__track">';
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
<?php if ( $entries->have_posts() ) : ?>
|
|
|
|
|
2024-10-02 17:54:05 +02:00
|
|
|
<ul class="grid-columns <?php if ( $splide ) { echo 'splide__list'; } ?>">
|
2024-09-06 01:26:42 +02:00
|
|
|
<?php while ( $entries->have_posts() ) : $entries->the_post(); ?>
|
|
|
|
|
|
|
|
<?php
|
|
|
|
// Setup
|
|
|
|
$post_id = $post->ID;
|
|
|
|
$story = fictioneer_get_story_data( $post_id, false ); // Does not refresh comment count!
|
|
|
|
$story_link = get_post_meta( $post_id, 'fictioneer_story_redirect_link', true ) ?: get_permalink( $post_id );
|
|
|
|
$tags = ( $show_terms && get_option( 'fictioneer_show_tags_on_story_cards' ) ) ? get_the_tags( $post ) : false;
|
|
|
|
$is_sticky = FICTIONEER_ENABLE_STICKY_CARDS && get_post_meta( $post_id, 'fictioneer_story_sticky', true );
|
|
|
|
$grid_or_vertical = $args['vertical'] ? '_vertical' : '_grid';
|
|
|
|
$card_classes = [];
|
|
|
|
|
|
|
|
// Description
|
|
|
|
$short_description = fictioneer_first_paragraph_as_excerpt(
|
|
|
|
fictioneer_get_content_field( 'fictioneer_story_short_description', $post_id )
|
|
|
|
);
|
|
|
|
$short_description = mb_strlen( $short_description, 'UTF-8' ) < 30 ? get_the_excerpt() : $short_description;
|
|
|
|
|
2025-01-12 18:00:18 +01:00
|
|
|
// Extra card classes
|
|
|
|
$card_classes[] = '_' . $args['post_status'];
|
|
|
|
|
2024-09-06 01:26:42 +02:00
|
|
|
if ( $show_terms ) {
|
|
|
|
$card_classes[] = '_info';
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( $is_sticky ) {
|
|
|
|
$card_classes[] = '_sticky';
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( ! empty( $post->post_password ) ) {
|
|
|
|
$card_classes[] = '_password';
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( get_theme_mod( 'card_style', 'default' ) !== 'default' ) {
|
|
|
|
$card_classes[] = '_' . get_theme_mod( 'card_style' );
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( $args['vertical'] ) {
|
|
|
|
$card_classes[] = '_vertical';
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( $args['seamless'] ) {
|
|
|
|
$card_classes[] = '_seamless';
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( ! $show_terms || ! ( $story['has_taxonomies'] || $tags ) ) {
|
|
|
|
$card_classes[] = '_no-tax';
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( ! $args['footer'] ) {
|
|
|
|
$card_classes[] = '_no-footer';
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( ! $args['footer_chapters'] ) {
|
|
|
|
$card_classes[] = '_no-footer-chapters';
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( ! $args['footer_words'] ) {
|
|
|
|
$card_classes[] = '_no-footer-words';
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( ! $args['footer_date'] ) {
|
|
|
|
$card_classes[] = '_no-footer-date';
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( ! $args['footer_status'] ) {
|
|
|
|
$card_classes[] = '_no-footer-status';
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( ! $args['footer_rating'] ) {
|
|
|
|
$card_classes[] = '_no-footer-rating';
|
|
|
|
}
|
|
|
|
|
2024-11-26 12:11:30 +01:00
|
|
|
if ( ! $args['footer_comments'] ) {
|
|
|
|
$card_classes[] = '_no-footer-comments';
|
|
|
|
}
|
|
|
|
|
2024-09-06 01:26:42 +02:00
|
|
|
if ( $splide ) {
|
|
|
|
$card_classes[] = 'splide__slide';
|
|
|
|
}
|
|
|
|
|
|
|
|
// Truncate factor
|
|
|
|
$truncate_factor = $args['vertical'] ? '_4-4' : '_cq-3-4';
|
|
|
|
|
|
|
|
// Card attributes
|
|
|
|
$attributes = [];
|
|
|
|
|
|
|
|
if ( $args['aspect_ratio'] ) {
|
|
|
|
$attributes['style'] = '--card-image-aspect-ratio: ' . $args['aspect_ratio'];
|
|
|
|
}
|
|
|
|
|
|
|
|
$attributes = apply_filters( 'fictioneer_filter_card_attributes', $attributes, $post, 'shortcode-latest-stories-compact' );
|
|
|
|
|
|
|
|
$card_attributes = '';
|
|
|
|
|
|
|
|
foreach ( $attributes as $key => $value ) {
|
|
|
|
$card_attributes .= esc_attr( $key ) . '="' . esc_attr( $value ) . '" ';
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
|
|
|
|
<li class="post-<?php echo $post_id; ?> card watch-last-clicked _small _story _compact _no-footer <?php echo implode( ' ', $card_classes ); ?>" <?php echo $card_attributes; ?>>
|
|
|
|
<div class="card__body polygon">
|
|
|
|
|
|
|
|
<?php if ( $args['infobox'] ) : ?>
|
2024-12-06 17:38:32 +01:00
|
|
|
<button class="card__info-toggle" aria-label="<?php esc_attr_e( 'Open info box', 'fictioneer' ); ?>" data-fictioneer-last-click-target="toggle" data-action="click->fictioneer-last-click#toggle"><i class="fa-solid fa-chevron-down"></i></button>
|
2024-09-06 01:26:42 +02:00
|
|
|
<?php endif; ?>
|
|
|
|
|
|
|
|
<div class="card__main <?php echo $grid_or_vertical; ?> _small">
|
|
|
|
|
|
|
|
<?php
|
|
|
|
do_action( 'fictioneer_shortcode_latest_stories_card_body', $post, $story, $args );
|
|
|
|
|
|
|
|
if ( $args['thumbnail'] ) {
|
|
|
|
fictioneer_render_thumbnail(
|
|
|
|
array(
|
|
|
|
'post_id' => $post_id,
|
|
|
|
'title' => $story['title'],
|
|
|
|
'classes' => 'card__image cell-img',
|
|
|
|
'permalink' => $story_link,
|
|
|
|
'lightbox' => $args['lightbox'],
|
|
|
|
'vertical' => $args['vertical'],
|
|
|
|
'seamless' => $args['seamless'],
|
|
|
|
'aspect_ratio' => $args['aspect_ratio']
|
|
|
|
)
|
|
|
|
);
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
|
|
|
|
<h3 class="card__title _small cell-title"><a href="<?php echo $story_link; ?>" class="truncate _1-1"><?php
|
|
|
|
if ( ! empty( $post->post_password ) ) {
|
|
|
|
echo '<i class="fa-solid fa-lock protected-icon"></i> ';
|
|
|
|
}
|
|
|
|
|
|
|
|
echo $story['title'];
|
|
|
|
?></a></h3>
|
|
|
|
|
|
|
|
<div class="card__content _small cell-desc">
|
|
|
|
<div class="truncate <?php echo $truncate_factor; ?>">
|
|
|
|
<?php if ( get_option( 'fictioneer_show_authors' ) && $args['source'] ) : ?>
|
|
|
|
<span class="card__by-author"><?php
|
|
|
|
printf( _x( 'by %s —', 'Small card: by {Author} —.', 'fictioneer' ), fictioneer_get_author_node() );
|
|
|
|
?></span>
|
|
|
|
<?php endif; ?>
|
|
|
|
<span><?php echo $short_description; ?></span>
|
|
|
|
</div>
|
2024-01-19 14:13:17 +01:00
|
|
|
</div>
|
2024-09-06 01:26:42 +02:00
|
|
|
|
2023-01-21 01:31:34 +01:00
|
|
|
</div>
|
|
|
|
|
2024-09-06 01:26:42 +02:00
|
|
|
<?php if ( $args['infobox'] ) : ?>
|
|
|
|
<div class="card__overlay-infobox escape-last-click">
|
|
|
|
|
|
|
|
<?php if ( $show_terms ) : ?>
|
|
|
|
<div class="card__tag-list _small <?php echo $args['terms'] === 'pills' ? '_pills' : ''; ?>">
|
|
|
|
<?php
|
|
|
|
if ( $story['has_taxonomies'] || $tags ) {
|
|
|
|
$variant = $args['terms'] === 'pills' ? '_pill' : '_inline';
|
|
|
|
|
|
|
|
$terms = array_merge(
|
|
|
|
$story['fandoms'] ? fictioneer_get_term_nodes( $story['fandoms'], "{$variant} _fandom" ) : [],
|
|
|
|
$story['genres'] ? fictioneer_get_term_nodes( $story['genres'], "{$variant} _genre" ) : [],
|
|
|
|
$tags ? fictioneer_get_term_nodes( $tags, "{$variant} _tag" ) : [],
|
|
|
|
$story['characters'] ? fictioneer_get_term_nodes( $story['characters'], "{$variant} _character" ) : []
|
|
|
|
);
|
|
|
|
|
|
|
|
$terms = apply_filters(
|
|
|
|
'fictioneer_filter_shortcode_latest_stories_terms',
|
|
|
|
$terms, $post, $args, $story
|
|
|
|
);
|
|
|
|
|
|
|
|
// Implode with separator
|
|
|
|
echo implode(
|
|
|
|
fictioneer_get_bullet_separator( 'latest-stories-compact', $args['terms'] === 'pills' ),
|
|
|
|
array_slice( $terms, 0, $args['max_terms'] )
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
?><span class="card__no-taxonomies"><?php _e( 'No taxonomies specified yet.', 'fictioneer' ); ?></span><?php
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
</div>
|
|
|
|
<?php else : ?>
|
|
|
|
<div class="card__overlay-description _small"><?php echo $short_description; ?></div>
|
|
|
|
<?php endif; ?>
|
2023-01-21 01:31:34 +01:00
|
|
|
|
2024-09-06 01:26:42 +02:00
|
|
|
<?php if ( $args['footer'] ) : ?>
|
|
|
|
<div class="card__footer _small">
|
2023-01-21 01:31:34 +01:00
|
|
|
|
2024-09-06 01:26:42 +02:00
|
|
|
<div class="card__footer-box _left text-overflow-ellipsis"><?php
|
2024-08-23 23:12:24 +02:00
|
|
|
|
2024-09-06 01:26:42 +02:00
|
|
|
// Build footer items
|
|
|
|
$footer_items = [];
|
2024-08-23 23:12:24 +02:00
|
|
|
|
2024-09-06 01:26:42 +02:00
|
|
|
if ( $args['footer_chapters'] && ( $story['status'] !== 'Oneshot' || $story['chapter_count'] > 1 ) ) {
|
|
|
|
$footer_items['chapters'] = '<span class="card__footer-chapters"><i class="card-footer-icon fa-solid fa-list" title="' . esc_attr__( 'Chapters', 'fictioneer' ) . '"></i> ' . $story['chapter_count'] . '</span>';
|
|
|
|
}
|
2024-08-23 16:44:04 +02:00
|
|
|
|
2024-09-06 01:26:42 +02:00
|
|
|
if ( $args['footer_words'] && ( $story['word_count'] > 2000 || $story['status'] === 'Oneshot' ) ) {
|
|
|
|
$footer_items['words'] = '<span class="card__footer-words"><i class="card-footer-icon fa-solid fa-font" title="' . esc_attr__( 'Total Words', 'fictioneer' ) . '"></i> ' . $story['word_count_short'] . '</span>';
|
|
|
|
}
|
2023-06-04 01:49:00 +02:00
|
|
|
|
2024-11-26 12:11:30 +01:00
|
|
|
if ( $args['footer_comments'] ) {
|
|
|
|
$footer_items['comments'] = '<span class="card__footer-comments"><i class="card-footer-icon fa-solid fa-message" title="' . esc_attr__( 'Comments', 'fictioneer' ) . '"></i> ' . get_comments_number( $post ) . '</span>';
|
|
|
|
}
|
|
|
|
|
2024-09-06 01:26:42 +02:00
|
|
|
if ( $args['footer_date'] ) {
|
|
|
|
$format = $args['date_format'] ?: FICTIONEER_LATEST_STORIES_FOOTER_DATE;
|
2023-01-21 01:31:34 +01:00
|
|
|
|
2024-09-06 01:26:42 +02:00
|
|
|
if ( $args['orderby'] === 'modified' ) {
|
|
|
|
$footer_items['modified_date'] = '<span class="card__footer-modified-date"><i class="card-footer-icon fa-regular fa-clock" title="' . esc_attr__( 'Last Updated', 'fictioneer' ) . '"></i> ' . get_the_modified_date( $format, $post ) . '</span>';
|
|
|
|
} else {
|
|
|
|
$footer_items['publish_date'] = '<span class="card__footer-publish-date"><i class="card-footer-icon fa-solid fa-clock" title="' . esc_attr__( 'Published', 'fictioneer' ) . '"></i> ' . get_the_date( $format, $post ) . '</span>';
|
|
|
|
}
|
|
|
|
}
|
2023-06-04 22:17:42 +02:00
|
|
|
|
2024-09-06 01:26:42 +02:00
|
|
|
if ( $args['footer_status'] ) {
|
2024-10-30 20:36:01 +01:00
|
|
|
$footer_items['status'] = '<span class="card__footer-status _' . strtolower( $story['status'] ) . '"><i class="card-footer-icon ' . $story['icon'] . '"></i> ' . fcntr( $story['status'] ) . '</span>';
|
2024-09-06 01:26:42 +02:00
|
|
|
}
|
2023-09-10 14:52:47 +02:00
|
|
|
|
2024-09-06 01:26:42 +02:00
|
|
|
// Filter footer items
|
|
|
|
$footer_items = apply_filters(
|
|
|
|
'fictioneer_filter_shortcode_latest_stories_card_footer',
|
|
|
|
$footer_items,
|
|
|
|
$post,
|
|
|
|
$story,
|
|
|
|
$args
|
|
|
|
);
|
2023-09-10 14:52:47 +02:00
|
|
|
|
2024-09-06 01:26:42 +02:00
|
|
|
// Implode and render footer items
|
|
|
|
echo implode( ' ', $footer_items );
|
2023-09-10 14:52:47 +02:00
|
|
|
|
2024-09-06 01:26:42 +02:00
|
|
|
?></div>
|
2024-08-21 22:53:24 +02:00
|
|
|
|
2024-09-06 01:26:42 +02:00
|
|
|
<?php if ( $args['footer_rating'] ) : ?>
|
2024-10-30 20:36:01 +01:00
|
|
|
<div class="card__footer-box _right rating-letter-label tooltipped _<?php echo strtolower( $story['rating'] ); ?>" data-tooltip="<?php echo fcntr( $story['rating'], true ); ?>">
|
2024-09-06 01:26:42 +02:00
|
|
|
<?php echo fcntr( $story['rating_letter'] ); ?>
|
|
|
|
</div>
|
|
|
|
<?php endif; ?>
|
2024-08-18 22:54:52 +02:00
|
|
|
|
2024-09-06 01:26:42 +02:00
|
|
|
</div>
|
|
|
|
<?php endif; ?>
|
2023-06-04 22:17:42 +02:00
|
|
|
|
2024-09-06 01:26:42 +02:00
|
|
|
</div>
|
|
|
|
<?php endif; ?>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</li>
|
2023-01-21 01:31:34 +01:00
|
|
|
|
2024-09-06 01:26:42 +02:00
|
|
|
<?php endwhile; ?>
|
|
|
|
</ul>
|
2023-01-21 01:31:34 +01:00
|
|
|
|
2024-09-06 01:26:42 +02:00
|
|
|
<?php else : ?>
|
2023-01-21 01:31:34 +01:00
|
|
|
|
2024-09-06 01:26:42 +02:00
|
|
|
<div class="no-results"><?php _e( 'Nothing to show.', 'fictioneer' ); ?></div>
|
2023-01-21 01:31:34 +01:00
|
|
|
|
2024-09-06 01:26:42 +02:00
|
|
|
<?php endif; wp_reset_postdata(); ?>
|
2023-01-21 01:31:34 +01:00
|
|
|
|
2024-09-06 01:26:42 +02:00
|
|
|
<?php if ( $splide ) { echo '</div>'; } ?>
|
2023-01-21 01:31:34 +01:00
|
|
|
</section>
|