Skip to content

Instantly share code, notes, and snippets.

@michaelschofield
Last active June 4, 2016 21:20
Show Gist options
  • Save michaelschofield/687441df25b5c5cd1c5e to your computer and use it in GitHub Desktop.
Save michaelschofield/687441df25b5c5cd1c5e to your computer and use it in GitHub Desktop.
Use Custom Feed for a Post Type
add_action( 'after_setup_theme', 'my_rss_template' );
function my_rss_template() {
if ( get_query_var( 'post_type' ) == 'post_type' ) {
add_feed( 'custom', 'my_custom_rss_render') ;
}
}
function my_custom_rss_render() {
get_template_part( 'feed', 'custom' );
}
@dsmy
Copy link

dsmy commented Aug 21, 2014

Hey Michael,

Came across your issue on the Advanced WP group. Had a similar issue to solve recently. The following links helped me, maybe they can be of some help to you.

http://churchm.ag/how-to-add-wordpress-custom-post-types-to-your-rss-feed/
http://wpsnippy.com/add-custom-post-types-wordpress-default-rss-feed/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment