-
-
Save monecchi/b11c7d1097b4e20f097847f1ff1cffd3 to your computer and use it in GitHub Desktop.
Multiple Custom Post Types to Wordpress main RSS Feed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add custom post types main RSS feed. | |
function wp_rss_feed( $query ) { | |
if ( $query->is_feed() ) | |
$query->set( 'post_type', array( 'post', 'events', 'books' ) ); | |
return $query; | |
} | |
add_filter( 'pre_get_posts', 'wp_rss_feed' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment