Reading > "Syndication feeds show the most recent" * (posts_per_rss). The feed will not work if a password is required unless * the viewer has entered the password. * * @package WordPress * @subpackage Fictioneer * @since 4.7 * @link https://github.com/WordPress/WordPress/blob/master/wp-includes/feed-rss2.php */ // Get ID from parameter $story_id = fictioneer_validate_id( $_GET[ 'story_id' ] ?? 0, 'fcn_story' ); $is_hidden = get_post_meta( $story_id ?: 0, 'fictioneer_story_hidden', true ); // Abort if not a valid story ID or password protected if ( ! $story_id || $is_hidden || post_password_required( $story_id ) ) { wp_redirect( home_url() ); exit(); } // Get story data $story = fictioneer_get_story_data( $story_id, false ); // Does not refresh comment count! $chapters = fictioneer_get_story_chapters( $story_id ); // Feed title $title = sprintf( _x( '%1$s - %2$s Chapters', 'Story Feed: [Site] - [Story] Chapters.', 'fictioneer' ), get_bloginfo_rss( 'name' ), get_the_title( $story_id ) ); // Feed description $description = sprintf( _x( 'Recent chapters of %s.', 'Story Feed: Recent chapters of [Story].', 'fictioneer' ), get_the_title( $story_id ) ); // Updated time (story) $date = mysql2date( 'D, d M Y H:i:s +0000', get_post_modified_time( 'Y-m-d H:i:s', true, $story_id ), false ); // Cover image $cover = fictioneer_get_seo_image( $story_id ); // Set header header( 'Content-Type: ' . feed_content_type( 'rss-http' ) . '; charset=' . get_option( 'blog_charset' ), true ); // Echo XML version echo ''; // Fire default action do_action( 'rss_tag_pre', 'rss2' ); ?> > <?php echo $title; ?> <?php echo $title; ?> 32 32 ' . $fandom->name . ''; } } if ( $story['genres'] ) { foreach ( $story['genres'] as $genre ) { echo '' . $genre->name . ''; } } if ( $story['characters'] ) { foreach ( $story['characters'] as $character ) { echo '' . $character->name . ''; } } if ( $story['tags'] ) { foreach ( $story['tags'] as $tag ) { echo '' . $tag->name . ''; } } ?> 'fcn_chapter', 'post_status' => 'publish', 'post__in' => $chapters, 'orderby' => 'post__in', 'posts_per_page' => get_option( 'posts_per_rss' ) + 4, // Buffer for hidden items 'no_found_rows' => true // Improve performance ); $chapter_query = new WP_Query( $query_args ); // Loop over chapters foreach ( $chapter_query->posts as $post ) { // Setup setup_postdata( $post ); // Terminate? if ( $terminator < 1 ) { break; } // Skip invisible chapters if ( get_post_meta( $post->ID, 'fictioneer_chapter_hidden', true ) ) { continue; } // Decrement terminator $terminator--; // Data $pub_date = mysql2date( 'D, d M Y H:i:s +0000', get_post_time( 'Y-m-d H:i:s', true ), false ); $og_image = fictioneer_get_seo_image( $post->ID ); // <-- Start HTML ?> <?php the_title_rss(); ?> ]]> ID, 'fcn_fandom' ) ) { foreach ( $chapter_fandoms as $fandom ) { echo '' . $fandom->name . ''; } } if ( $chapter_genres = get_the_terms( $post->ID, 'fcn_genre' ) ) { foreach ( $chapter_genres as $genre ) { echo '' . $genre->name . ''; } } if ( $chapter_characters = get_the_terms( $post->ID, 'fcn_character' ) ) { foreach ( $chapter_characters as $character ) { echo '' . $character->name . ''; } } if ( $chapter_tags = get_the_tags( $post->ID ) ) { foreach ( $chapter_tags as $tag ) { echo '' . $tag->name . ''; } } rss_enclosure(); do_action( 'rss2_item' ); ?>