Images – img alt tag showing different values ​​then entered

If you are drawing the image with custom code you can call alt_text. I hope this can help you if you are searching for $alt text only

$alt_text = get_post_meta($post->ID, '_wp_attachment_image_alt', true);

Edit 1:

If you are dragging the image through wordpress function then only you can see that the alt tag is also being pulled in the output.
<?php echo wp_get_attachment_image( get_the_ID(), array('700', '600'), "", array( "class" => "img-responsive" ) ); ?>

If you only have an image with the URL being called manually, you can add alt as a variable which should probably pull the alt description as follows:

<img src=" method to call URL" alt="<?php echo $alt_text; ?>

Leave a Comment