I have two RSS feed on my WordPress blog:
- mydomain.com/feed/
- mydomain.com/feed/anotherfeed/
Is it possible to set different items limits on these? I want to show 10 items for the first feed, but the second I want to show 30 items.
Thanks in advance
Sure, you can. First create the feed as per codex:
function anotherfeed_init(){
add_feed('anotherfeed');
}
add_action('init', 'anotherfeed_init');
Now, change the post count for this particular feed:
function anotherfeed_post_count( $query ) {
if( $query->is_main_query() && is_feed('anotherfeed') )
$query->set( 'posts_per_rss', 30 );
}
add_action( 'pre_get_posts', 'anotherfeed_post_count' );