我只是一个ACF,我创建了一个ID,并将其作为一个ID进行镜像。除了alt标记没有被输出外,代码都工作得很好。
我做错了什么?
<?php
$attachment_id_desktop = get_sub_field(\'image\');
$size_desktop = "column-size"; // (thumbnail, medium, large, full or custom size)
$image_desktop = wp_get_attachment_image_src( $attachment_id_desktop, $size_desktop );
$alt_desktop = get_post_meta($attachment_id_desktop , \'_wp_attachment_image_alt\', true);
?>
<img class="img-fluid desktop" alt="" src="<?php echo $image_desktop[0]; ?>" alt="<?php echo $alt_desktop; ?>"/>