ID; $list_title = trim( get_post_meta( $post_id, 'fictioneer_collection_list_title', true ) ); $title = empty( $list_title ) ? fictioneer_get_safe_title( $post_id, 'card-collection' ) : $list_title; $excerpt = fictioneer_first_paragraph_as_excerpt( fictioneer_get_content_field( 'fictioneer_collection_description', $post_id ) ); $excerpt = empty( $excerpt ) ? fictioneer_get_excerpt( $post_id ) : $excerpt; $statistics = fictioneer_get_collection_statistics( $post_id ); $items = get_post_meta( $post_id, 'fictioneer_collection_items', true ); $items = empty( $items ) ? [] : $items; $card_classes = []; // Taxonomies $tags = false; $fandoms = false; $characters = false; $genres = false; if ( get_option( 'fictioneer_show_tags_on_collection_cards' ) && ! get_option( 'fictioneer_hide_taxonomies_on_collection_cards' ) ) { $tags = get_the_tags(); } if ( ! get_option( 'fictioneer_hide_taxonomies_on_collection_cards' ) ) { $fandoms = get_the_terms( $post_id, 'fcn_fandom' ); $characters = get_the_terms( $post_id, 'fcn_character' ); $genres = get_the_terms( $post_id, 'fcn_genre' ); } // Flags $show_terms = ! get_option( 'fictioneer_hide_taxonomies_on_collection_cards' ) && ( $fandoms || $characters || $genres || $tags ); // Query featured posts if ( ! empty( $items ) ) { $items = new WP_Query( array( 'post_type' => 'any', 'post_status' => 'publish', 'post__in' => $items ?: [0], // Must not be empty! 'ignore_sticky_posts' => true, 'orderby' => 'modified', 'posts_per_page' => 3, 'update_post_meta_cache' => false, // Improve performance 'update_post_term_cache' => false, // Improve performance 'no_found_rows' => true // Improve performance ) ); $items = $items->posts; } // Extra classes if ( get_theme_mod( 'card_style', 'default' ) !== 'default' ) { $card_classes[] = '_' . get_theme_mod( 'card_style' ); } if ( get_theme_mod( 'card_image_style', 'default' ) !== 'default' ) { $card_classes[] = '_' . get_theme_mod( 'card_image_style' ); } if ( ! $show_terms ) { $card_classes[] = '_no-tax'; } // Card attributes $attributes = apply_filters( 'fictioneer_filter_card_attributes', [], $post, 'card-collection' ); $card_attributes = ''; foreach ( $attributes as $key => $value ) { $card_attributes .= esc_attr( $key ) . '="' . esc_attr( $value ) . '" '; } // Thumbnail attributes $thumbnail_args = array( 'alt' => sprintf( __( '%s Thumbnail', 'fictioneer' ), $title ), 'class' => 'no-auto-lightbox' ); ?>
  • >

    %4$s', get_the_post_thumbnail_url( null, 'full' ), sprintf( __( '%s Thumbnail', 'fictioneer' ), $title ), fictioneer_get_lightbox_attribute(), get_the_post_thumbnail( null, 'cover', $thumbnail_args ) ); } // Content printf( '
    %2$s
    ', count( $items ) > 2 ? '_cq-4-3' : '_4-4', fictioneer_truncate( $excerpt ?: __( 'No description provided yet.', 'fictioneer' ), 512 ) ); ?>