WordPress feeds are a great way to let people know when something new lands on your site. By default if you browse to your site + “/feed” WordPress will return an XML formatted RSS feed. The big flaw in WordPress feeds is that by default “new” only includes blog posts, not new pages. Luckily this oversight is easy to fix. Just add the following code to the bottom of your theme’s functions.php file and everything just works.
// make sure pages are displayed in RSS feed (posts only by default)
function add_pages_to_feed( $query ) {
if ( is_feed() ) {
$query->set( 'post_type', array( 'post', 'page' ) );
}
return $query;
}
add_filter( 'pre_get_posts', 'add_pages_to_feed' );
