1

I have a parent theme and a child theme (spacious).

I have made a custom post type called "job-openings". a single page (using single-job-openings.php in the child theme folder) - which works fine, at www.domain.com/job-openings/test-job-opp/

but the archive page (using archive-job-openings.php in the child theme folder) does not work at www.domain.com/job-openings/ - i get a 'Page not Found' error.

i have tried to re-submit the 'permalinks' section under settings (as well as changing to default and then back to post name), but that has not helped.

Anyone know what the issue could be?

Thanks

This is the code i used in the functions.php file to add the post type:

    add_action( 'init', 'create_position_post_type' );

    function create_position_post_type() {
        register_post_type( 'job-openings',
        array(
        'labels' => array(
        'name' => __( 'Job Openings' ),
        'singular_name' => __( 'Job Opening' )
        ),
        'public' => true,
        'rewrite' => array('slug' => 'job-openings'),
        'query_var' => true,
        'menu_position' => '100',
        'supports' => array('title','editor','thumbnail', 'page-attributes'),
        )
        );
    }
  • 2
    Try using 'has_archive' => true in your code. – jas Nov 24 '15 at 11:13
2

Maybe because you're missing has_archive

Something like this

'public' => true, 'has_archive' => true,

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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