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.

For the site I am making, I have a few post types: News, Events, Projects, Placements. Each one of these post types will need its own archive page, accessible through the navigation. I am able to create these post types using the Types plugin, but my question is how do I create a archive page for them? I can't figure out what the URL will be. /projects for the post type with slug projects gives me nothing.

I think I understand how the templates for custom post types work (archive-{post-slug}.php), but I don't know how to make these pages accessible.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

When a post type is registered, you need to at least set has_archive to true. This will use the post type name as the slug for archive. You can also specify a string representing the slug for has_archive:

'has_archive' => 'projects'

This should be accessible under Type's advanced settings, according to their documentation.

share|improve this answer
    
I've got that set to true. Still can't access it via /projects, though? Not sure if I'm supposed to be able to? –  Oliver Joseph Ash Aug 2 '12 at 19:54
    
has_archive is checked. It says this below: Allow custom post type to have index page. Default: not set. –  Oliver Joseph Ash Aug 2 '12 at 19:57
    
I'm using Types because I find the WordPress API very confusing! –  Oliver Joseph Ash Aug 2 '12 at 19:58
    
I'm not familiar with how Types works, so it may be a question for their support. If the post type is registered as projects, then setting has_archive to true should make the archive available at that slug. –  Milo Aug 3 '12 at 17:17
    
Got it in the end. Forgot to actually make a template! Now I need help with this: wordpress.stackexchange.com/questions/60732/… –  Oliver Joseph Ash Aug 3 '12 at 17:21

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.