【问题标题】:Wordpress theme doesn't show set featured image button in custom post typesWordpress 主题在自定义帖子类型中不显示设置特色图片按钮
【发布时间】:2014-09-08 12:19:45
【问题描述】:

我正在使用Gonzo Wordpress theme,我注意到在我创建的自定义帖子类型中缺少将图像添加到帖子的按钮。

functions.php 中激活了对缩略图的支持:

add_theme_support('post-thumbnails');

我尝试添加一组自定义帖子类型:

add_theme_support('post-thumbnails', array('post', 'page', 'article', 'cpt1', 'cpt2', 'cpt3'));

但这并没有改变任何东西。

当我注册自定义帖子类型时,支持缩略图:

    'supports' => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'trackbacks', 'custom-fields', 'comments', 'revisions', 'page-attributes' ),

问题出在哪里?

【问题讨论】:

  • 您是否检查了特色图片的框是否未隐藏在屏幕选项中?

标签: wordpress wordpress-theming custom-post-type


【解决方案1】:

移动这条线

add_theme_support('post-thumbnails');

functions.php 文件的底部实际上解决了这个问题。

我不确定这是否真的是一个解决方案。把它放在底部有意义吗?是否有一些参数可以传递给这个或其他函数来改变执行顺序?

【讨论】:

    猜你喜欢
    • 2016-01-10
    • 2013-10-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-12-26
    • 1970-01-01
    • 2014-04-20
    • 2012-10-15
    相关资源
    最近更新 更多