首页 文章

分层自定义帖子类型不显示页面属性中的页面模板列表

提问于
浏览
1

我创建了一个自定义分层帖子类型 .

这是自定义帖子类型代码:

// 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 ..但没有我得到我正确的answare :(

请帮帮我 .

这是页面当前视图的屏幕截图

current view

1 回答

  • 0

    您已经解决了它,但要使用父级,您需要具有相同类型的另一个项目 . 创建一个项目,下次执行该项目时,它将显示父选择器 . Wordpress只允许您选择与另一个类型相同的项目 .

    希望这可以帮助 .

相关问题