如何指定缩略图图像的链接。我有不同网站缩略图的投资组合,我必须添加链接。
<div class="showcase-image">
<?php
$thumbnail = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'large' );
if(has_post_thumbnail()): echo '<img src="'.$thumbnail[0].'"/>'; else: ?>
<?php endif; ?>
</div>
答案 0 :(得分:0)
试试这个
<div class="showcase-image">
<?php
$thumbnail = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'large' );
if(has_post_thumbnail()): echo '<a href="'.$thumbnail[0].'" > <img src="'.$thumbnail[0].'"/></a>'; else: ?>
<?php endif; ?>
</div>