我正在尝试向名为slides(admin.php?page=slides)的自定义页面添加自定义帖子类型,但它不想工作。这是我第一次尝试使用页面的技术插件。自定义页面创建得很好,但是当我包含生成自定义帖子类型的函数时,它不会加载到视图中。我的页面生成代码为:
add_submenu_page(\'slideroo\',
\'Slides\', \'Slides\', \'manage_options\',
\'sliderama-slides\', \'slides_page\');
我注册帖子类型的功能是:
function slides_page()
{
$labels = array(
\'name\' => _x(\'My Slides\', \'post type general name\'),
\'singular_name\' => _x(\'Slide Item\', \'post type singular name\'),
\'add_new\' => _x(\'Add New\', \'Slide item\'),
\'add_new_item\' => __(\'Add New Slide Item\'),
\'edit_item\' => __(\'Edit Slide Item\'),
\'new_item\' => __(\'New Slide Item\'),
\'view_item\' => __(\'View Slide Item\'),
\'search_items\' => __(\'Search Slide\'),
\'not_found\' => __(\'Nothing found\'),
\'not_found_in_trash\' => __(\'Nothing found in Trash\'),
\'parent_item_colon\' => \'\'
);
$args = array(
\'labels\' => $labels,
\'public\' => true,
\'publicly_queryable\' => true,
\'show_ui\' => true,
\'query_var\' => true,
\'menu_icon\' => null,
\'rewrite\' => true,
\'capability_type\' => \'post\',
\'hierarchical\' => false,
\'menu_position\' => null,
\'supports\' => array(\'title\',\'editor\',\'thumbnail\')
);
register_post_type( \'slideroo\' , $args );
谢谢