我正在Wordpress上使用一个WCK插件。在调用图像源代码的php代码中,我使用wp_get_attachment_image_src()
但它只获取图像的url。我想包括它的alt值。请帮忙。谢谢
下面是我的代码。
<div class="authortest-cont">
<h2><span>W</span>hat Our <small>Authors Say</small></h2>
<?php
$wck_custom = get_post_meta( $post->ID, \'testimonialsbox\', true);
foreach($wck_custom as $wck_cstm) {
$author_name = $wck_cstm[\'author_name\'];
$author_img = $wck_cstm[\'author_img\'];
$author_testimonial = $wck_cstm[\'author_testimonial\'];
if( is_numeric( $author_img ) ) {
$attach_author_img = wp_get_attachment_image_src( $author_img, \'full\' );
$src_author_img = $attach_author_img[0];
}
else {
$src_author_img = $author_img;
}
?>
<div class="col-md-6 col-sm-6">
<?php echo $author_testimonial; ?>
<div class="author-det">
<img src="<?php echo $src_author_img; ?>" alt=""/>
</div>
</div>
<?php } ?>
</div>
如何echo
该图像的alt值?