Hi @ahni,
Yep absolutely, if you add something like the code below to your theme’s functions.php then simply change the 5 to whatever the ID of the category is you wish to restrict it to.
if ( ! function_exists( 'wpna_restrict_feed_category' ) ) :
/**
* Modifies the main RSS query.
*
* @param WP_Query $query
* @return $query
*/
function wpna_restrict_feed_category( $query ) {
// Requested option name, / value to default to.
if ( function_exists( 'wpna_get_option' ) ) {
// get the feed slug.
$feed_slug = wpna_get_option( 'fbia_feed_slug' );
// If it's the Instant Articles feed
if ( $query->is_feed( $feed_slug ) && $query->is_main_query() ) {
// Restrict to only show posts in a certain category.
$query->set( 'cat', 5 );
}
}
return $query;
}
endif;
add_filter( 'pre_get_posts', 'wpna_restrict_feed_category', 11, 1 );
Thanks