Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm trying to get the custom archives per post-type working, but after a week of trying, searching and scratching head I still cannot get it working. I'm mainly talking about the {post-type}/{year} or {post-type}/{year}/{month} permalinks. They always throw a 404. Only index.php?year={year}&monthnum={month}&post_type={post_type} links do work. So right now I temporarily created some custom rewrite rules which translate permalinks in working links.

But, how to get the native archive functionality working for post-types? I am clueless about what is the difference between the archive-{posttype}.php, type-{posttype} and date.php templates and tried all of them to get them working. No luck though. type-{posttype}.php does work in order to list all the post-types, but archive-{posttype}.php or date.php do not make the /{year}/{month} permalinks to work.

Basically what I need is:

/{post-type} to list all the posts of this custom post type

/{post-type}/{year} to list all of them of a particular year

/{post-type}/{year}/{month} to specify further on a month.

And lastly: is there a template to be created which outputs all the years and months of the custom post type with wp_get_archives()? Or do I have to create a different template to create them for each post-type?

Hope I was a bit clear. Running on wp3.1

share|improve this question
add comment

2 Answers

You should consider asking one question at a time.

And lastly: is there a template to be created which outputs all the years and months of the custom post type with wp_get_archives()? Or do I have to create a different template to create them for each post-type?

You mean like this: http://scribu.net/wordpress/smart-archives-reloaded

share|improve this answer
    
You're right. Not so sure if this is what I mean, will look into it. Tnx –  grrrbytes Feb 28 '11 at 19:47
add comment

What do your permalink structure look like? Have you already read this on Codex?

EDIT: similar thread over here. Might fit your needs.

share|improve this answer
    
tnx, it's a start! /{post-type} archive pages work now, but /{post-type}/{year}/{month} pages still throw 404's. –  grrrbytes Feb 28 '11 at 19:45
    
@Mixhael: Normally it should be http://example.com/{year}/{month}/{day}/{sample-post}/ according to the permalinks settings (admin ui > settings > permalinks > 2nd choice "day and name"). Are you sure about what you're trying to acchieve? –  kaiser Feb 28 '11 at 22:07
    
ok, so this means that post-type specific date based archives only work with custom rewrite rules? –  grrrbytes Mar 1 '11 at 21:17
    
Until 3.1 custom post types had no archives at all. I haven't got enough time to take a deeper look into it now, but i guess there should already be some documentation about it at the codex. From a short google i only found this link. Maybe it helps: mark.mcwilliams.me/2010/10/… –  kaiser Mar 1 '11 at 22:02
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.