There are a couple of different solutions if you want to have only the /holliday/project-location/ URL and not separate archive and taxonomy URLs.
Option 1:
Use the template_include()
filter. I think this code would work but have not tested:
add_filter( 'template_include', 'holliday_template', 99 );
function holliday_template( $template ) {
if ( is_post_type_archive( 'holliday' ) ) {
$new_template = locate_template( array( 'taxonomy-my_project_location.php' ) );
if ( '' != $new_template ) {
return $new_template;
}
}
return $template;
}
Option 2 (even simpler):
Tell WP not to give your holliday
CPT an archive. When you register the post type, just change 'has_archive' => true,
to false
. That way, when WP looks for content at your desired URL, only the taxonomy archive exists. You will most likely need to use unregister_post_type()
and re-register it to force the change.