Wordpress 菜单中的 CPT 存档

问题描述

我正在尝试在我的 wordpress 菜单添加实际的存档(无需自定义链接,因为我现在要...https://domain-name.com/services/)。

我希望我的客户能够从菜单区域左侧的选项中选择服务档案。

我不想列出此存档中的各种服务(请参阅下面的 PHP 函数),因此我保留了;

'show_in_nav_menus' => false;

我希望在菜单部分中可选择的是实际存档,在这种情况下,根据页面 slug 选择“服务”。

我希望在类别下的菜单区域中看到这个,但它不在那里?

     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');

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)