I'm trying to add the actual Archive in my Wordpress menu, (without needing to do a custom link to it, as I am now to... https://domain-name.com/services/).
I'd like my client to be able to select the services archive from the options on the left in the menu area.
I don't want to list out the various services within this archive (see functions php below) hence me keeping the;
'show_in_nav_menus' => false;
What I instead want to be selectable in the menu section is the actual archive, in this case 'services' as per the page slug.
I expected to see this in the menu area under categories, but it's not there?
function custom_services_post_type()
{
$args = array(
'public' => true,
'publicly_queryable' => true,
'show_ui' => true,
'exclude_from_search' => true,
'show_in_nav_menus' => false,
'has_archive' => true,
'hierarchical' => true,
'labels' => array(
'name' => 'Our Services',
'singular_name' => 'Service',
'add_new' => __('Add A Service'),
'add_new_item' => __('New Service'),
'edit_item' => __('Edit The Service'),
'new_item' => __('New Service'),
'all_items' => __('All Services'),
'view_items' => __('View Services'),
'menu_name' => 'Services'
),
'supports' => array(
'title',
'custom-fields',
'post-formats'
),
'description' => 'Biddenden Chiropractic services',
'menu_icon' => 'dashicons-list-view',
);
register_post_type('services', $args);
}
add_action('init', 'custom_services_post_type');
question from:
https://stackoverflow.com/questions/65921894/cpt-archive-in-wordpress-menu 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…