has\\u post\\u缩略图似乎工作正常,但\\u post\\u缩略图没有返回任何内容。
这是我的代码:
if ($favorite_post_ids):
foreach ($favorite_post_ids as $post_id) {
$p = get_post($post_id);
echo "<li>";
echo "<a href=\'".get_permalink($post_id)."\' title=\'". $p->post_title ."\'>" . $p->post_title . "</a> ";
wpfp_remove_favorite_link($post_id);
if (has_post_thumbnail($post_id))
{
echo $post_id;
the_post_thumbnail($post_id);
}
echo "</li>";
}
以下是示例输出:* Post101 remove 101
* Post97 remove 97
* Post59 remove 59
上面的大部分代码都是无关的,我只是为了清楚起见才把它包括进去。我回显了$post\\u id,以确保它正在传递if(has\\u post\\u缩略图($post\\u id)),它确实传递了if,但\\u post\\u缩略图会自动失败。我也试着重复了一下,但也没有什么结果。我在主题中打开了post\\u缩略图:
if ( function_exists( \'add_theme_support\' ) ) {
add_theme_support( \'post-thumbnails\' );
}
any ideas? thanks