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.

First I will show my permalink structure: /%category%/%post-name%/

Then, I created a custom post type. And now I want to create an archive for those posts related to my custom post type. So I wonder, how will I do that?

Viewing it in the WordPress documentation, there is something about create a archive-{post-type}.php file, but I still don't understand how it works, and it says nothing about how the permalinks will look like.

What should I do?

share|improve this question
    
@Peter: To clarify it a bit: what URLs do you want to work? Archives with like /[post-type]/, /[post-type]/page/2/, ... or should they include a taxonomy too? –  Jan Fabry Feb 17 '11 at 14:01
add comment

migrated from stackoverflow.com Feb 15 '11 at 15:55

This question came from our site for professional and enthusiast programmers.

2 Answers

Custom post types don't have archives, this will be a new feature in WP 3.1 (with the has_archive argument when registering them). There are multiple ways for emulating these archives in WP 3.0, one of them is explained in another question here.

share|improve this answer
add comment

A quote from that question:

By registering the custom post type (with a "movie" slug), the permalinks are already set up for

<domain>/movie/action/

...to see all movies in the action genre.

That! That is what not work for me. But that is excacly how I want it to work.

share|improve this answer
    
@Peter: Are you the "Peter Westerlund" from the original question? In that case, you should be able to register here too and "associate" your account with your Stack Overflow account. You will get ownership of the question, so you can update it and post comments on my answer (because this is not a "classic" forum, you should not write this followup as a new "answer", it could get ignored). (Use @Jan when you reply to this comment and I get a notification) –  Jan Fabry Feb 16 '11 at 10:03
    
@Jan Aha, yes it is me. But in some way it logs in with different accounts. At home I loged in with my Facebook accoutn but here at work it loged in automaticly with my work adress. And okey, I'm new here. I will try to post an answer instead in the future. –  Peter Westerlund Feb 16 '11 at 10:16
    
@Peter: No problem! You are currently an "Unregistered user" with this account, maybe because you can't access Facebook at work? You can try to log in with another OpenID provider, and then ask the team to merge your accounts so you can login with either Facebook or another provider. See the "contact us" link at the bottom of this page. –  Jan Fabry Feb 16 '11 at 10:34
    
@Jan Ok! I think i'm online with right account now. So, would like that we go back to my last question now. What is the answer for that? About the quote I wrote above. –  Peter Westerlund Feb 16 '11 at 12:42
    
It seems your accounts are merged now, so I suggest you delete this answer and update your question with the extra information. Otherwise it will be very hard for others to follow the conversation. –  Jan Fabry Feb 17 '11 at 15:35
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.