我想显示附件的实际图像,而不是附件的 url。我正在使用此代码,但它正在显示网址:
<?php
$argsThumb = array(
'order' => 'ASC',
'post_type' => 'attachment',
'post_parent' => $post->ID,
'post_status' => null
);
$attachments = get_posts($argsThumb);
if ($attachments) {
foreach ($attachments as $attachment) {
apply_filters('the_title', $attachment->post_title);
echo wp_get_attachment_url($attachment->ID, false, false);
}
}
?>