Viewing 1 replies (of 1 total)
  • Try

    $src = get( $field, $group_index, $field_index, $post_id );
    $alt = get_post_meta( get_data( $field, $group_index, $field_index, $post_id )['meta_value'], '_wp_attachment_image_alt', true );
    echo "<img src=\"$src\" alt=\"$alt\">";

    where in your case $field = ‘photo_post_img’, $group_index = 1, $field_index = 1, $post_id = $post->ID (assuming global $post)

    mc

Viewing 1 replies (of 1 total)
  • The topic ‘How can i get alt attribute for images?’ is closed to new replies.