Created CPT = news
uses default categories (IT and recruitment) I am struggling to view an archive of the posts based on their category
mysite/news/ - shows all posts for that CPT whatever the category - good
mysite/news/recruitment - 404
mysite/category/recruitment - 404
mysite/news/category/recruitment - 404
(not sure which one of the last 3 should work)
Here is the code I am using - I imagine I'm missing the basics somewhere - thanks
add_action( 'init', 'cptui_register_my_cpts' );
function cptui_register_my_cpts() {
$labels = array(
"name" => "News",
"singular_name" => "News",
);
$args = array(
"labels" => $labels,
"description" => "",
"public" => true,
"show_ui" => true,
"has_archive" => false,
"show_in_menu" => true,
"exclude_from_search" => false,
"capability_type" => "post",
"map_meta_cap" => true,
"hierarchical" => true,
"rewrite" => array( "slug" => "news", "with_front" => true ),
"query_var" => true,
"taxonomies" => array( "category" )
);
register_post_type( "news", $args );
// End of cptui_register_my_cpts()
}