Skip to content

Instantly share code, notes, and snippets.

@jaredatch
Created September 18, 2013 18:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jaredatch/6613183 to your computer and use it in GitHub Desktop.
Save jaredatch/6613183 to your computer and use it in GitHub Desktop.
Add CPT to primary site feed
<?php
/**
* Add custom post type (slideshow) to primary RSS feed
*
* @since 1.0.0
* @param array $vars
* @return array
*/
function ja_feed_request( $vars ) {
if ( isset( $vars['feed'] ) && !isset( $vars['post_type'] ) )
$vars['post_type'] = array( 'post', 'slideshow' );
return $vars;
}
add_filter( 'request', 'ja_feed_request' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment