Thanks to @Jacob Peattie for pointing me in the right direction. I was able to get the code to display exactly what I needed it to with the following syntax. My intent was to get an admin level category page to only display new categories for contractors like painters, fencing, roofers, etc. Initially, it redirected me to the blog post categories which I didn’t want to use. Now with the following register_taxonomy
function, I was able to get a new admin page for the contractor’s categories.
// Contractor Post Types
register_post_type('contractors', array(
'show_in_rest' => true,
'supports' => array('title', 'editor', 'excerpt', 'thumbnail','taxonomies'),
'rewrite' => array('slug' => 'contractors'),
'has_archive' => true,
'public' => true,
'labels' => array(
'name' => 'Contractors',
'add_new_item' => 'Add New Contractor',
'edit_item' => 'Edit_Contractor',
'all_items' => 'All Contractors',
'singular_name' => 'Contractor'
),
'menu_icon' => 'dashicons-admin-tools',
'taxonomies' => array
(
'contractors_category',
'post_tag'
)
));
// Registering the contractor taxonomy
register_taxonomy('contractors_category', 'contractors', array(
'label' => 'Categories',
'rewrite' => array('slug' => 'contractors-category'),
'show_in_rest' => true,
'hierarchical' => true
));
// Registering the contractor tags taxonomy
register_taxonomy('contractors_tags', 'contractors', array(
'label' => 'Tags',
'rewrite' => array('slug' => 'contractors-tags'),
'show_in_rest' => true
));