I've created a couple of custom post types:
add_action( 'init', 'register_post_types' );
function register_post_types() {
register_post_type(
'jobsearch-post',
array(
'labels' => array(
'name' => __( 'Job Searches Post' ),
'singular_name' => __( 'Job Search Post' )
),
'public' => true,
'has_archive' => true,
'rewrite' => array(
'slug' => 'jobsearch'
)
)
);
register_post_type(
'recruiters-post',
array(
'labels' => array(
'name' => __( 'Recruiters Post' ),
'singular_name' => __( 'Recruiter Post' )
),
'public' => true,
'has_archive' => true,
'rewrite' => array(
'slug' => 'recruiters'
)
)
);
}
Which appear to be working correctly. However, I have a couple of related taxonomies:
add_action( 'init', 'register_taxonomies' );
function register_taxonomies() {
register_taxonomy(
'recruiters-tax',
array (
0 => 'recruiters-post',
),
array(
'hierarchical' => true,
'label' => 'Recruiters Taxonomy',
'show_ui' => true,
'query_var' => true,
'rewrite' => array(
'slug' => ''
),
'singular_label' => 'Recruiter Taxonomy'
)
);
register_taxonomy(
'jobsearch-tax',
array (
0 => 'jobsearch-post',
),
array(
'hierarchical' => true,
'label' => 'Job Searches Taxonomy',
'show_ui' => true,
'query_var' => true,
'rewrite' => array(
'slug' => ''
),
'singular_label' => 'Job Search Taxonomy'
)
);
}
As you can see these are hierarchical. Unfortunately, though, I get a 404 ONLY if I try to access items within the recruiters taxonomy, e.g:
http://localhost:8888/recruiters/some-category
I can access job postings: http://localhost:8888/jobsearch/some-category
And I can also access the root custom post types:
http://localhost:8888/recruiters
http://localhost:8888/jobsearch
Is there something I'm missing that is preventing me from reaching nested taxonomies from only the recruiters taxonomy?
Note that I have been constantly hitting the "Save Changes" button in my permalink settings in between trying to get this to work.
This is driving me crazy!