在代码的顶部,在$large_image
, 您可以添加以下内容:
$image_alt = get_post_meta((int)get_post_meta( get_the_ID() , "_thumbnail_id" , true ), \'_wp_attachment_image_alt\', true);
$image_title = get_the_title((int)get_post_meta( get_the_ID() , "_thumbnail_id" , true ));
The
alt
附件已入库
post_meta
(
_wp_attachment_image_alt
), 标题是
post_title
.
然后替换printf()
.
EDIT:
printf( "<div class=\'shoe %s\' data-image=\'%s\' data-large-image=\'%s\' ><div class=\'shoe-outer\' ><div class=\'shoe-inner\' ><img src=\'%s\' alt=\'%s\' title=\'%s\' ></div></div></div>", join(" ", $terms_array ), esc_attr( $image[0] ), esc_attr( $large_image[0] ), $brand_image, $image_alt, $image_title );
告诉我这是不是工作:)