2017-04-17 85 views

回答

0

get_user_favorites()只是返回數組中的後ID。如果您將這些ID傳遞給get_the_post_thumbnail(),您將獲得使用圖像縮略圖的圖像標記的html,因爲它是src屬性。例如:

$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>'; 
}