ID; $title = fictioneer_get_safe_title( $post_id, 'card-chapter' ); $story_id = fictioneer_get_chapter_story_id( $post_id ); $story_post = get_post( $story_id ); $story_unpublished = get_post_status( $story_id ) !== 'publish'; $story_data = $story_id ? fictioneer_get_story_data( $story_id, false ) : null; // Does not refresh comment count! $chapter_rating = get_post_meta( $post_id, 'fictioneer_chapter_rating', true ); $story_thumbnail_url_full = $story_id ? get_the_post_thumbnail_url( $story_id, 'full' ) : null; $text_icon = get_post_meta( $post_id, 'fictioneer_chapter_text_icon', true ); $excerpt = fictioneer_get_forced_excerpt( $post, 512, true ); $card_classes = []; if ( ! $chapter_rating && $story_id ) { $chapter_rating = get_post_meta( $story_id, 'fictioneer_story_rating', true ); } // Taxonomies $tags = false; $fandoms = false; $characters = false; $genres = false; if ( get_option( 'fictioneer_show_tags_on_chapter_cards' ) && ! get_option( 'fictioneer_hide_taxonomies_on_chapter_cards' ) ) { $tags = get_the_tags(); } if ( ! get_option( 'fictioneer_hide_taxonomies_on_chapter_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 $hide_author = $args['hide_author'] ?? false && ! get_option( 'fictioneer_show_authors' ); $show_terms = ! get_option( 'fictioneer_hide_taxonomies_on_chapter_cards' ) && ( $tags || $fandoms || $characters || $genres ); // Extra classes if ( $story_unpublished ) { $card_classes[] = '_story-unpublished'; } 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-chapter' ); $card_attributes = ''; foreach ( $attributes as $key => $value ) { $card_attributes .= esc_attr( $key ) . '="' . esc_attr( $value ) . '" '; } // Thumbnail attributes $thumbnail_args = array( 'alt' => sprintf( __( '%s Cover', '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 ) ); } elseif ( ! empty( $story_thumbnail_url_full ) ) { printf( '%4$s', $story_thumbnail_url_full, sprintf( __( '%s Thumbnail', 'fictioneer' ), $title ), fictioneer_get_lightbox_attribute(), get_the_post_thumbnail( $story_id, 'cover', $thumbnail_args ) ); } elseif ( ! empty( $text_icon ) ) { printf( '%3$s', get_permalink(), esc_attr( $title ), get_post_meta( $post_id, 'fictioneer_chapter_text_icon', true ) ); } } // Content printf( '
    %1$s%2$s
    ', $hide_author ? '' : sprintf( '%s ', sprintf( _x( 'by %s —', 'Large card: by {Author} —.', 'fictioneer' ), fictioneer_get_author_node() ) ), empty( $excerpt ) ? __( 'No description provided yet.', 'fictioneer' ) : $excerpt ); ?>