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 have the following:

//Jobs
register_post_type( 'jobs',
    array(
        'labels' => array(
            'name' => __( 'Jobs' ),
            'singular_name' => __( 'Job' )
        ),
    'public' => true,
        'show_ui' => true,
    'has_archive' => false,
        'hierarchical' => true,
        'query_var' => true,
        'supports' => array( 'title', 'editor', 'comments', 'trackbacks', 'revisions','author', 'excerpt', 'custom-fields', 'thumbnail', 'page-attribute' ),
    'rewrite' => array('slug' => 'jobs', 'with_front' => true),
        'taxonomies' => array( 'post_tag', 'category'),
        'can_export' => true,
    'show_in_nav_menus' => true,
    //'capability_type'=>'jobs',
    //'capabilities' => array(
    //  'read_post' => 'read_jobs'
    //),
    )
);

I tried this: 'has_archive' => false,

But the Jobs custom post type is still using the archive.php template.

Any ideas of what is wrong here?

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

If you are wanting to use a specialized archive template for your custom type, you need an additional archive file. This is named in the form of:

archive-[custom post type name].php

Since your code listing has jobs as the type name, the archive file would be named:

archive-jobs.php

This can resemble the standard archive template, or can be tailored as suits the nature of the custom content type.

share|improve this answer
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.