1

In Wordpress 3.9.2 I couldn't find the way to have a custom post type which would have the feed permalink like this:

example.com/custom-post-type/feed/

But didn't show the archive (show 404) for:

example.com/custom-post-type/

Just for the sake of completeness it should display the single post:

example.com/custom-post-type/post-1

The relevant $args I've tried to change:

    $args = array(
        'capability_type'     => 'post',
        'has_archive'         => true,
        'rewrite'             => array('slug' => 'custom-post-type', 'feeds' => true, 'feed' => true),

My research shows that when the has_archive is set to false, the feed doesn't work.

  • You could always add your own feed, just copy the RSS Template and modify it to your CPT. – Howdy_McGee Aug 22 '14 at 13:53
  • From quick look at a source feed rewrite rules are chained to it having archive pretty tight. :\ Not sure if recreating them separately would be enough to make it work. – Rarst Aug 22 '14 at 15:16
  • @Howdy_McGee thanks for the input, but I'm not sure it's the right direction (or I might misunderstood what you're suggesting) - the point is to use the existing feeds not to create new ones. – MythThrazz Aug 22 '14 at 15:26
  • @Rarst I have exaclty the same impression. – MythThrazz Aug 22 '14 at 15:27
  • I am coming to the same conclusions, has_archive => true seems to be required. I will be playing with the rewrite rules next, for a great little plugin to help troubleshoot and visually see which rewrite rules get applied have a look at Moneyman Rewrite Analyzer – farinspace Nov 14 '15 at 23:54

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.