Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/276.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php wordpress向分类法参与者添加图像_Php_Wordpress_Custom Taxonomy - Fatal编程技术网

Php wordpress向分类法参与者添加图像

Php wordpress向分类法参与者添加图像,php,wordpress,custom-taxonomy,Php,Wordpress,Custom Taxonomy,我想向我的自定义分类法actor添加一个图像,但是当我查看编辑actor选项时,它只显示选项名称、slug和description。 对于上述问题,我需要在functions.php中添加一个选项 //////////////////////////////////// // TAXONOMY ACTORS // //////////////////////////////////// register_taxonomy( 'actor', arr

我想向我的自定义分类法actor添加一个图像,但是当我查看编辑actor选项时,它只显示选项名称、slug和description。 对于上述问题,我需要在functions.php中添加一个选项

////////////////////////////////////
//         TAXONOMY ACTORS        //
////////////////////////////////////

register_taxonomy(
    'actor',
    array( 'movies' ),
    array(
        'labels'            => array(
        'name'              => __( 'Actors' ),
        'singular_name'     => __( 'Actor' ),
        'search_items'      => __( 'Search Actors' ),
        'all_items'         => __( 'All Actors' ),
        'parent_item'       => __( 'Parent Actor' ),
        'parent_item_colon' => __( 'Parent Actor:' ),
        'view_item'         => __( 'View Actor' ),
        'edit_item'         => __( 'Edit Actor' ),
        'update_item'       => __( 'Update Actor' ),
        'add_new_item'      => __( 'Add New Actor' ),
        'new_item_name'     => __( 'New Actor Name' ),
        'menu_name'         => __( 'Actor' ),
        ),
        'hierarchical'      => false,
        'show_ui'           => true,
        'show_admin_column' => true,
        'query_var'         => true,
        'rewrite'           => array( 'slug' => 'actor' ),
    )
);

我已经尝试在这里找到了如何实现这一点而不必询问,因此非常感谢您的帮助。

尝试添加
支持
参数:

'supports' => array( 'thumbnail' ),
例如:

...
        'hierarchical'      => false,
        'show_ui'           => true,
        'show_admin_column' => true,
        'query_var'         => true,
        'rewrite'           => array( 'slug' => 'actor' ),
        'supports'          => array( 'thumbnail' ),
    )
);
有关详细信息,请参阅以下内容中的“步骤5:功能实现”

“支持”=>数组(“标题”、“编辑器”、“注释”、“缩略图”、“自定义字段”)
确定要显示的自定义文章类型的功能


我已经将上述代码添加到我的functions.php中,现在我只需要一个选项,将图像文件添加到edit actor页面。我已经成功地将支持添加到我的functions.php中。但是,我如何在我的网站上查看图像,因为它肯定已将其保存给某个分类参与者。tvmYou可以问一个关于下一阶段任务的新问题。你越详细地描述你已经做过的事情和你遇到的困难,社区中的人就会越早为你提供合适的解决方案。请解释投票失败的原因。它帮助我和其他人改正错误。