Posted By

fabienthomas on 09/13/10


Tagged

rss feed post wordpress custom


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

techdetours
athanassiadis
crypticsoft


Add custom post type to rss feed [WordPress]


 / Published in: PHP
 

  1. add_filter( 'pre_get_posts', 'my_get_posts' );
  2. function my_get_posts( $query ) {
  3. if ( is_feed() )
  4. $query->set( 'post_type', array( 'post', 'snippet' ) );
  5. return $query;
  6. }

Report this snippet  

You need to login to post a comment.