Update RSS templates
This commit is contained in:
parent
373baa55c9
commit
89a305fde4
@ -11,7 +11,7 @@
|
||||
// Query posts
|
||||
$posts = new WP_Query(
|
||||
array (
|
||||
'post_type' => array( 'post', 'fcn_story', 'fcn_chapter', 'fcn_recommendation' ),
|
||||
'post_type' => ['post', 'fcn_story', 'fcn_chapter', 'fcn_recommendation'],
|
||||
'post_status' => 'publish',
|
||||
'orderby' => 'date',
|
||||
'order' => 'DESC',
|
||||
@ -65,6 +65,7 @@ echo '<?xml version="1.0" encoding="' . get_option( 'blog_charset' ) . '"?>';
|
||||
|
||||
// Fire default action
|
||||
do_action( 'rss_tag_pre', 'rss2' );
|
||||
|
||||
?>
|
||||
|
||||
<rss
|
||||
|
@ -131,17 +131,28 @@ do_action( 'rss_tag_pre', 'rss2' );
|
||||
// Limit items
|
||||
$terminator = get_option( 'posts_per_rss' );
|
||||
|
||||
// Query
|
||||
$query_args = array(
|
||||
'post_type' => '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 ( $chapters as $post_id ) {
|
||||
foreach ( $chapter_query->posts as $post ) {
|
||||
// Setup
|
||||
$post = get_post( $post_id );
|
||||
setup_postdata( $post );
|
||||
|
||||
// Terminate?
|
||||
if ( $terminator < 1 ) break;
|
||||
|
||||
// Skip invisible chapters
|
||||
if ( fictioneer_get_field( 'fictioneer_chapter_hidden' ) || get_post_status() !== 'publish' ) {
|
||||
if ( fictioneer_get_field( 'fictioneer_chapter_hidden' ) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user