我不这么认为,但你可以get_children 并获取这些帖子的附件:
$attachments = get_children(array(
\'post_parent\' => $post->ID, // <- source post
\'post_status\' => \'inherit\',
\'post_type\' => \'attachment\',
\'post_mime_type\' => \'image\',
\'order\' => \'post_date\',
\'orderby\' => \'DESC\',
\'numberposts\' => 5, // the number
));
然后获取图像URL:
$size = \'post-thumbnail\'; // or whatever size you need
foreach($attachments as $att){
list($source, $width, $height) = wp_get_attachment_image_src($att->ID, $size);
// echo \'<img src="\'.$source.\'" width="\'.$width.\'" height=\'".$height."\' />\';
}