【发布时间】:2017-09-11 16:15:24
【问题描述】:
替代文字未显示...
$images = get_post_meta(get_the_id(), 'vdw_gallery_id', true);
if( $images ): ?>
<ul>
<?php foreach( $images as $image ): ?>
<li>
<a href="<?php echo wp_get_attachment_image_url($image, 'large'); ?>">
<img src="<?php echo wp_get_attachment_image_url($image, 'medium'); ?>" alt="Alter TEXT" />
</a>
</li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
我尝试了很多方法,但没有得到如何回显我为图库创建元字段的更改文本。
我知道 wp_get_attachment_image_src 这将显示所有内容,但我只需要在循环中回显“alt”文本。
【问题讨论】:
标签: php wordpress metadata custom-post-type alt