Show alt as sent in admin panel
-
I want to show the alt text as set in admin panel for an image specially logo but my site is showing some other text for alt and not what I have set in admin panel. I am using the following code for showing user defined alt text but its not working for logo though it works for rest of the images in the website.
Here is the code I’m using on other pages for showing alt text:
$thumb_id = get_post_thumbnail_id(get_the_ID()); $alt = get_post_meta($thumb_id, '_wp_attachment_image_alt', true);
And in image I am doing like this:
<img src="img-source-value" alt="<?php echo $alt; ?>" />
This same code works for other images but not on site logo image. Can please someone tell me what’s wrong in this code for logo image? Thanks in advance.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Show alt as sent in admin panel’ is closed to new replies.