Wordpress 获取用户最喜爱的帖子缩略图

Wordpress 获取用户最喜爱的帖子缩略图,wordpress,post,Wordpress,Post,此代码“用户收藏夹列表($user\u id、$site\u id、$include\u links、$filters、$include\u button);”显示文章标题。如何获取帖子缩略图?只返回数组中的帖子ID。如果将这些ID传递给获取“\u post\u thumbnail()”,则将获取使用图像缩略图作为src属性的html for image标记。例如: $array_of_post_ids = get_user_favorites($user_id, $site_id, $incl

此代码“用户收藏夹列表($user\u id、$site\u id、$include\u links、$filters、$include\u button);”显示文章标题。如何获取帖子缩略图?

只返回数组中的帖子ID。如果将这些ID传递给获取“\u post\u thumbnail()”,则将获取使用图像缩略图作为src属性的html for image标记。例如:

$array_of_post_ids = get_user_favorites($user_id, $site_id, $include_links, $filters, $include_button);
foreach ($array_of_post_ids as $post_id){
     echo '<div class="post-thumbnail-' . $post_id .'">;
     echo get_the_post_thumbnail($post_id);
     echo '</div>';
}
$array\u of\u post\u id=get\u user\u favorites($user\u id、$site\u id、$include\u links、$filters、$include\u button);
foreach($post\u id的数组作为$post\u id){
回声';
echo获取发布缩略图($post\u id);
回声';
}