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' ); ?>