Hi,
I'm using a child theme of twentyten. example.com/cpt/ redirects to archive-cpt.php as expected, but example.com/cpt/2011/02 goes straight to the 404 page.
As far as I know, it was working just yesterday and I haven't changed anything. It looks like the permalinks stopped working properly as printing the query array on the 404 page gives Array ( [page] => /02 [cpt] => 2011 [post_type] => cpt [name] => 2011 )
How can I force it to write the correct query like it does for built in posts?
I've already tried refreshing the permalink settings but the problem still persists.
I've figured it out. Rewrite rules have to be added. I modified the code from the Custom Post Types plugin.
I think what happened was that I didn't refresh the permalinks when I deactivated the plugin and just assumed everything was working. So when I refreshed them again they all got lost.
Aaron Wagner
Member
Posted 10 months ago #
Can you enlighten me on how you accomplished this? I would like to do something similar. Specifically the rewrite rules that you used?
I have a series of blog posts about it. It's not meant to be a tutorial, instead it's a record of what I tried to get it working. The first post is at the link below.
http://wpadventures.wordpress.com/2011/02/13/custom-post-type-archives/
I have made a little PHP class that register CPT with support of archives by dates.
You can found it there : WP Custom Post Type with archives per dates