-
-
Hi,
Unfortunately all our site SEO reviews are pointing us to this issue – missing Alt and Title text eventhough they have been set in the media / image attributes.
I have seen a few posts related to this and need your help to guide me with step by step changes that I need to do in order to show allt and title texts for my images please?
I have a simple website with standard pages. No portfolios or blogs.
Thanks a lot!
Dan
-
Hello,
By default the alt and title are not included in media. This is a decision of theme developers. However you can add them by customizing the responsible code. Check this related ticket for it: https://support.codeless.co/?topic=image-alt-tags-missing-on-home-page
Best regards!
-
Hi,
I added code in media.php, latest_blog.php and loop-grid.php.
The alt text for media elements is being shown if I use view source but is not being displayed when mouse is placed over image. This is fine.
However, I noticed that media which is inserted in page as a ‘Service Media’ element have empty alt tags. Any idea why?
Thanks and regards,
Daniela
-
Hi,
I fixed this by updating code in services_media.php. Can you please help me fix the code for the featured staff image in element Single Staff?
Thanks
-
Hello,
Open file vc_templates/staff.php and find these lines:
while ($additional_loop->have_posts()) { $additional_loop->the_post(); $content = get_the_content(); $featured = codeless_image_by_id(get_post_thumbnail_id(), 'staff', 'url');
Right above
$featured
, add this line:
$alt = get_post_meta(get_post_thumbnail_id(), '_wp_attachment_image_alt', true);
Now scroll down to line (38):
$output .= '<img src="'.esc_url($featured).'" alt=" ">';
Edit to this:$output .= '<img src="'.esc_url($featured).'" alt="'.$alt.'">';
Result screenshot: https://ibb.co/q5YBjdtFind all file’s edited code here: https://codeshare.io/5eNVVx
Best regards!
-
-
You must be logged in to reply to this topic.