Created
April 16, 2017 20:55
-
-
Save douglasanro/a9c50ec42528fbb492c3a20ac94220fb to your computer and use it in GitHub Desktop.
Add CPT to your main WP 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
<?php | |
/* ---------------------------------------------------------------------------- | |
* Add CPT to your main WordPress RSS feed | |
* ------------------------------------------------------------------------- */ | |
function simple_feed_request( $rss ) { | |
if ( isset( $rss[ 'feed' ] ) && !isset( $rss['post_type'] ) ) { | |
// Return all post types | |
$rss['post_type'] = | |
// Return posts of post types of your choice like 'post' and 'news' | |
//$rss['post_type'] = array( 'post', 'news' ); | |
} | |
return $rss; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment