2015-04-15 298 views
0

我正在使用插件自动精选图像自动设置缩略图。并在数据库中显示更新的元缩略图键。WordPress不显示缩略图

Wordpress Database meta keys

但由于某些原因,它没有显示的功能图像。它也不显示“占位符”。它什么也没有显示。

此外,当我尝试查看单个页面上的附件时,它不显示它。

如何继续查找问题?如果您需要我的数据库中不同表格的更多截图,请询问。我非常感谢你的时间。

编辑

$meta_values = get_post_meta($POST_ID, '_thumbnail_id'); 
error_log(var_dump($meta_values)) //Prints nothing on error log 

//Note: $POST_ID is fine, it contains the right id. Problem not there. 

编辑2:

if (has_post_thumbnail($post_parent_id)){ 
error_log("THUMB EXISTS". get_post_thumbnail_id($post_parent_id)); 
} 

真的怪异结果:

拇指存在: “空格,没有ID或字符串在所有” ...

+0

请提供您用于显示它的代码。 –

+0

我没有做任何特别的事情。这是默认的WordPress主题。即使我将其更改为另一个WordPress主题,它仍然不起作用。 –

+0

@NielsvanRenselaar更新了一些问题:) –

回答

0

1)获得后的缩略图与帖子ID full description

<?php echo get_the_post_thumbnail($page->ID, 'thumbnail'); ?> 

2)在循环full description

<?php 
if (has_post_thumbnail()) { // check if the post has a Post Thumbnail assigned to it. 
    the_post_thumbnail(); 
} 
?> 

3想得到拇指网址? 。使用此

$url = wp_get_attachment_url(get_post_thumbnail_id($post->ID)); 
<img src="<?php echo $url; ?>" longdesc="URL_2" alt="Text_2" />