Wordpress特色图像元变量不显示在屏幕选项中

时间:2022-06-18 06:07:14

So... I've been trying to figure this out all morning, I can't get featured images to display for posts in Wordpress. This is a newly updated (4.2.1) install, and the first time trying to add this feature globally.

所以...我一直试图在整个早上想出这个,我无法在Wordpress中显示特色图片以显示帖子。这是一个新更新的(4.2.1)安装,也是第一次尝试全局添加此功能。

I tried using

我试过用

add_theme_support( 'post-thumbnails' );

with no luck.

没有运气。

I have a custom post type below where it does work set up like

我在下面有一个自定义帖子类型,它的工作设置就像

function wp_my_custom_thing() {
    if(function_exists('add_theme_support')) {
        add_theme_support( 'post-thumbnails', array( 'customthing' ) );
    }
    add_image_size('customsize', 2000, 750, true);
}
add_action('after_setup_theme', 'wp_my_custom_thing');

but the same doesn't work for doing it globally even though it appears to execute and doesn't throw an error. Also there are no errors in the PHP log or in wp-debug

但是,即使它似乎执行并且没有抛出错误,它也无法全局地执行。此外,PHP日志或wp-debug中没有错误

Also maybe notable, this is a multisite install, but each site has it's own theme. I've read that specifying post types like

也许值得注意的是,这是一个多站点安装,但每个站点都有自己的主题。我已经读过指定类型的帖子类型

add_theme_support( 'post-thumbnails', 'posts' );

can have some issues, although I have tested it, and it also doesn't work.

可能有一些问题,虽然我已经测试过了,但它也没有用。

Any ideas?

1 个解决方案

#1


They are turned off by default.

它们默认关闭。

Go to Network Admin > Settings > Network Settings > Upload Settings and check Media upload button.

转到网络管理>设置>网络设置>上传设置,然后选中媒体上传按钮。

This line is only for your custom post type:

此行仅适用于您的自定义帖子类型:

add_theme_support( 'post-thumbnails', array( 'customthing' ) );

Best just to leave it at:

最好只留下:

add_theme_support( 'post-thumbnails');

#1


They are turned off by default.

它们默认关闭。

Go to Network Admin > Settings > Network Settings > Upload Settings and check Media upload button.

转到网络管理>设置>网络设置>上传设置,然后选中媒体上传按钮。

This line is only for your custom post type:

此行仅适用于您的自定义帖子类型:

add_theme_support( 'post-thumbnails', array( 'customthing' ) );

Best just to leave it at:

最好只留下:

add_theme_support( 'post-thumbnails');