Skip to content

Instantly share code, notes, and snippets.

@norcross
Created March 8, 2013 05:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save norcross/5114371 to your computer and use it in GitHub Desktop.
Save norcross/5114371 to your computer and use it in GitHub Desktop.
include CPT in an RSS feed
<?php
function mmk_rss_include( $query ) {
if (!$query->is_feed)
return $query;
$query->set( 'post_type' , array( 'post', 'YOUR_POST_TYPE_NAME' ) );
return $query;
}
add_filter ( 'pre_get_posts', 'mmk_rss_include' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment