0

I'm trying to add Custom Post Types so they show in my Wordpress feed i.e. the url on my local machine being http://localhost:8888/example/feed

On various articles on the internet I've seen the following code, but when I add this to my functions.php and go to the above url none of my custom post types show on the feed? It just shows some XML and information.

Do I need to add anything to my custom post types file?

Any ideas on how to get this to work would be fabulous.

// CUSTOM POST TYPES IN RSS FEED
function myfeed_request( $qv ) {
  if ( isset( $qv['feed'] ) ) {
      $qv['post_type'] = get_post_types();
  }
  return $qv;
}
add_filter( 'request', 'myfeed_request' );

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.