我已经创建了一个自定义帖子类型,我想直接链接到主导航菜单中自定义帖子类型中的一些帖子。
我可以在菜单页面的左侧看到帖子,也可以将帖子添加到我的主菜单,但是保存后链接不会出现在网站的前端。
保存后,链接仍在管理面板的菜单视图中。
以下是我传递给register_post_type
功能:
public $labels = array(
\'name\' => \'Special Offers\',
\'singular_name\' => \'Special Offer\',
\'add_new\' => \'Add New Special Offer\',
\'all_items\' => \'All Special Offers\',
\'add_new_item\' => \'Add New Offer\',
\'edit_item\' => \'Edit Offer\',
\'new_item\' => \'New Offer\',
\'view_item\' => \'View Offer\',
\'search_items\' => \'Search Special Offers\',
\'not_found\' => \'No Offers found\',
\'not_found_in_trash\' => \'No Offers found in trash\',
\'parent_item_colon\' => \'Parent Offer:\',
\'menu_name\' => \'Special Offers\'
);
public $args = array(
\'description\' => "",
\'public\' => true,
\'exclude_from_search\' => false,
\'publicly_queryable\' => true,
\'show_ui\' => true,
\'show_in_nav_menus\' => true,
\'show_in_menu\' => true,
\'show_in_admin_bar\' => true,
\'menu_position\' => 26,
\'capability_type\' => \'post\',
\'hierarchical\' => false,
\'supports\' => array(\'title\',\'editor\',\'thumbnail\'),
\'has_archive\' => true,
\'query_var\' => true,
\'can_export\' => true,
\'rewrite\' => array(\'slug\' => \'specialoffers\')
);
其他一切都与我的自定义帖子类型完美配合。
请任何人建议一种方法,使自定义帖子类型的链接出现在我的主菜单中,或为我诊断问题?