特色图片metabox不显示自定义后类型

问题描述:

我试图添加特色图片为自定义后类型特色图片metabox不显示自定义后类型

我已经加入我的主题的functions.php文件的主题支持。以下是代码:

function custom_theme_setup() { 
    add_theme_support('post-formats',array('link','gallery')); 
    add_theme_support('post-thumbnails'); 
    add_theme_support('custom-background'); 
    add_theme_support('custom-header'); 
    add_theme_support('custom-logo'); 
    add_theme_support('automatic-feed-links'); 
    // add_theme_support('html5'); 
    add_theme_support('title-tag'); 
} 
add_action('init', 'custom_theme_setup'); 

我也尝试添加支持条款的注册后类型部分仍然没有。

这里是寄存器定义文章类型代码:

function movies_create_post_type() { 
    register_post_type('movies', 
    array(
     'labels' => array(
     'name' => __('Movies'), 
     'singular_name' => __('Movie'), 
     'supports' => array('title', 'editor', 'comments', 'excerpt', 'custom-fields', 'thumbnail'), 
    ), 
     'public' => true, 
     'has_archive' => true, 
     'menu_icon' => 'dashicons-format-video', 
     'show_ui' => true, 
    ) 
); 
} 

add_action('init','movies_create_post_type'); 

我已经到处搜寻,但无法找到这个问题得到妥善解决。

注意:我可以设置为我的普通帖子设置特色图像,问题是与 自定义帖子类型。我还注册了自定义帖子类型,通过我自己编码的 插件。

在此先感谢。

+1

尝试将支持阵列两项指标外,就像公共has_archive MENU_ICON show_ui – Poria

+0

非常感谢。工作! –

+0

发布为帮助他人的答案! – Poria

尝试将支持阵列两项指标外,就像公共has_archive MENU_ICON show_ui像

function movies_create_post_type() { 
    register_post_type('movies', 
    array(
     'labels' => array(
     'name' => __('Movies'), 
     'singular_name' => __('Movie') 
    ), 
     'public' => true, 
     'supports' => array('title', 'editor', 'comments', 'excerpt', 'custom-fields', 'thumbnail'), 
     'has_archive' => true, 
     'menu_icon' => 'dashicons-format-video', 
     'show_ui' => true, 
    ) 
); 
} 

希望它能帮助!

在支持论点的标签阵列无法通过

'supports' => array('title', 'editor', 'comments', 'excerpt', 'custom-fields', 'thumbnail'), 

请检查下面的代码

function movies_create_post_type() { 
    register_post_type('movies', 
    array(
     'labels' => array(
     'name' => __('Movies'), 
     'singular_name' => __('Movie') 
    ), 
     'public' => true, 
     'supports' => array('title', 'editor', 'comments', 'excerpt', 'custom-fields', 'thumbnail'), 
     'has_archive' => true, 
     'menu_icon' => 'dashicons-format-video', 
     'show_ui' => true, 
    ) 
); 
} 

更多信息检查register_post_type