admin管理员组

文章数量:1435859

I am developing my own theme and for logo I use tag:

<?php
   $image_url = get_theme_mod( 'header_logo_image_home', '' );
   $image_id = attachment_url_to_postid($image_url );
?>
   <picture class="lozad" data-src="<?php echo wp_get_attachment_image_src( $image_id, 'logo' )[0]; ?> 1x, <?php echo wp_get_attachment_image_src( $image_id, 'logo-retina' )[0]; ?>  2x" data-alt="====> ? HOW ? <====">
   <source srcset="<?php echo wp_get_attachment_image_src( $image_id, 'logo' )[0]; ?>  1x, <?php echo wp_get_attachment_image_src( $image_id, 'logo-retina' )[0]; ?>  2x">
   </picture>

Is there any way do get ALT based on 'attachment_url_to_postid'?

PS: I use element with lozad.js lazyload script.

Thanks!

本文标签: imagesHow can I add quotaltquot tag to ltpicturegt element