Created
August 30, 2017 13:14
-
-
Save strangerstudios/a1464da470313a6c6cf9ff8afd8622b5 to your computer and use it in GitHub Desktop.
Tell WordPress to only include posts of type post in the RSS feed.
This file contains 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
/* | |
Only posts of type post in the RSS feed. | |
*/ | |
function my_pre_get_posts_filter_rss($query) { | |
if ($query->is_feed) { | |
$query->set('post_type', 'post'); | |
} | |
return $query; | |
} | |
add_filter('pre_get_posts','my_pre_get_posts_filter_rss'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment