我创建了一个自定义分层帖子类型。
这是自定义帖子类型代码:
// Register Custom Post Type
function landing_page() {
$labels = array(
'name' => _x( 'Pages', 'Post Type General Name', 'download_saga' ),
'singular_name' => _x( 'Landing Page', 'Post Type Singular Name', 'download_saga' ),
'menu_name' => __( 'Landing Page', 'download_saga' ),
'parent_item_colon' => __( 'Parent Page:', 'download_saga' ),
'all_items' => __( 'All Pages', 'download_saga' ),
'view_item' => __( 'View Page', 'download_saga' ),
'add_new_item' => __( 'Add New Pages', 'download_saga' ),
'add_new' => __( 'New Landing Page', 'download_saga' ),
'edit_item' => __( 'Edit Page', 'download_saga' ),
'update_item' => __( 'Update Page', 'download_saga' ),
'search_items' => __( 'Search pages', 'download_saga' ),
'not_found' => __( 'No pages found', 'download_saga' ),
'not_found_in_trash' => __( 'No pages found in Trash', 'download_saga' ),
);
$rewrite = array(
'slug' => 'landingpage',
'with_front' => true,
'pages' => true,
'feeds' => true,
);
$args = array(
'label' => __( 'landingpage', 'download_saga' ),
'description' => __( 'Create Landing Page for Different Browser', 'download_saga' ),
'labels' => $labels,
'supports' => array( 'title', 'editor', 'page-attributes' ),
'hierarchical' => true,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'show_in_nav_menus' => true,
'show_in_admin_bar' => true,
'menu_position' => 20,
'menu_icon' => 'http://www.downloadsaga.com/wp-content/themes/ProjectR/images/lpage.png',
'can_export' => true,
'has_archive' => false,
'exclude_from_search' => true,
'publicly_queryable' => true,
'query_var' => 'landingpage',
'rewrite' => $rewrite,
'capability_type' => 'page',
);
register_post_type( 'landingpage', $args );
}
// Hook into the 'init' action
add_action( 'init', 'landing_page', 0 );
这是我进入编辑器页面时显示页面属性小部件,但它不显示页面模板列表。因此,我无法为自定义帖子页面选择页面模板。我已经创建了 3 页模板,它与 wordpress 默认页面功能配合得很好。
知道问题是什么以及如何解决吗?
我试过找到 wordpress codex、wordpress 支持页面、stackoverflow、ask.com .. 但我没有找到正确的答案:(
请帮帮我。
这是页面当前视图的屏幕截图