Go to paramlink page from WordPress’s menu Settings->paramlinks and update the settings (don’t need to change any settings) by clicking save changes (or maybe you don’t need to update the settings, only visiting the paramlinks page is enough) and then try to view your custom posts. It’ll show up.
I solved it this way.
I tried that already, and mentioned having tried it in my initial post. I guess I’ll upgrade again and try it again, in case there was something funky the first time.
Tried it again, same result.
To clarify – I’m not trying to access a single post, but an archive of posts. I have a custom post type called “podcast”, so visiting http://example.com/podcasts/category-name shows all posts of type “podcast” within the category “category-name”.
Individual posts using the link structure /podcast/full-post-title work just fine.
I realize I’m using a very customized and uncommon setup here, I just wonder if anyone else has had this issue and/or if there’s a fix (beyond “downgrade to 3.6.1 for the timebeing”).
I’m making a little bit of progress. I did print_r on the wp_query on my archive.php page, and it shows that the category name AND post-type are indeed being passed through. Now I just can’t figure out why it’s using archive.php instead of category.php
revmitcz, I had the same issue with Custom Post Types and media attachments. Visiting a custom post would bring up the attachment.php page and it was because the Post title and Attachment had the same name. I renamed the attachment and then I could view my custom post properly.
revmitcz, I have the same problem but haven’t found a solution yet, will post if I do, hopefully someone will solve it soon.
Well, I’m relieved to know I’m not the only one with this issue. But, I’m also worried that if I had been auto-upgraded to 3.7 (as will apparently be the case from 3.7 onward), my site would’ve broken pretty badly.
Hmm. I’ve been hit with this on some of my custom post types (not on others, though).
Here’s what I’ve been able to determine:
They’ll display again if I use this setting in the register_post_type function:
'hierarchical' => false,
Then I re-save the permalinks page (flushing the rewrite rules).
I also dumped the rewrite rules in both 3.6.1 and 3.7.1 and found some differences. I have this rule in my 3.6.1 dump:
["programs/(.+?)(/[0-9]+)?/?$"]=>
string(68) "index.php?post_type=hdnet_programs&name=$matches[1]&page=$matches[2]"
Based on a process of elimination, I believe that the corresponding rule in 3.7.1 is this:
["(.+?)(/[0-9]+)?/?$"]=>
string(72) "index.php?post_type=hdnet_programs&pagename=$matches[1]&page=$matches[2]"
Hope this helps…
cm
I had this problem, too. I solved it by again disabling all plugins, re-updating, and saving the updated permalink structure. This broke Bullet Proof Security, which needed to be reactivated. After re-activation, everything is back to normal.
We solved it by changing
'hierarchical' => true,
to
'hierarchical' => false,
Don’t know why having it set to true would cause the break of the permalink structure, this may be a core bug.
Same thing was happening to one of my 3.7.1 sites.
'hierarchical' => false
was the fix after resaving my permalink structure.
I was looking for this issue under just 404 permalink custom post type and it didn’t come up. However once I added 3.7.1 then I saw others with issues.
Thank you for helping us solve this bug.
Just tried upgrading to 3.7.1, and noticed I’d not defined 'hierarchical' => false
in my theme’s functions.php file (thereby using the default “false”).
Went ahead and added that in, saved my permalinks in the admin and.. same issue. My permalinks are going to what is basically my “custom post type = podcast” overview page. The page’s TITLE, interestingly enough, displays the category correctly. So, perhaps it’s something on the page itself where I’m defining which PHP file to use.
Okay, after doing a print_r
of $wp_query
on the page itself (which is archive.php), all the info appears correct. That is to say – it’s printing out exactly the same information that it would if it were on the page for that category (12 posts from that category, along with associated data).
For some reason, however, WP is redirecting to the archive.php
page and NOT the category.php
page.
Any ideas? Right now, I’m thinking I should play around with some of the options I set in my functions.php file where I define the custom post type.
Okay, it turns out I was doing a lot more custom routing of the permalinks than I thought. It’s not pretty, but it works now.
It was expecting a URL like :
/category/podcasts/category-name
but, I’d set it up to use :
/podcasts/category-name
I’m sure I set it up a little weird, cause I share category names across podcast post types AND blog posts, but I wrote a little permalink redirect in the functions.php file so now both methods work fine.
Thanks for your help, everyone!
For what it’s worth, though this is marked as resolved, I did find another interesting fact: ‘hierarchical’ can still be set to true if ‘query_var’ is set to true as well when you set up the custom post type.
This actually makes more sense to me, I think, if I read the documentation correctly.
cm