Tagged: alt, alternative text, seo
-
AuthorPosts
-
September 29, 2019 at 1:58 pm #1143086
Hello,
In portfolio entry page, I have checked source codes to see “ALT” definition of mansory gallery images. There was “TITLE” definiton, but no “ALT” definition. This is not good for SEO. How can I fix it?
<a href="https://www.kazdaglariotel.com/wp-content/uploads/2014/09/site-bahcesi-peyzaj-projesi-05.jpg" id='av-masonry-1-item-1707' data-av-masonry-item='1707' class='av-masonry-entry isotope-item post-1707 attachment type-attachment status-inherit hentry av-masonry-item-with-image av-landscape-img' title="TITLE" itemprop="thumbnailUrl" ><div class='av-inner-masonry-sizer'></div><figure class='av-inner-masonry main_color'><div class="av-masonry-outerimage-container"><div class="av-masonry-image-container" style="background-image: url(https://www.kazdaglariotel.com/wp-content/uploads/2014/09/site-bahcesi-peyzaj-projesi-05-705x396.jpg);" title="TITLE" ></div></div><figcaption class='av-inner-masonry-content site-background'><div class='av-inner-masonry-content-pos'><div class='av-inner-masonry-content-pos-content'><div class='avia-arrow'></div><h3 class='av-masonry-entry-title entry-title ' itemprop="headline" >TITLE</h3></div></div></figcaption></figure></a><!--end av-masonry entry-->
October 1, 2019 at 7:29 am #1143574Hey Cemal Onur,
Thank you for using Enfold.
You can include the alt attribute in the markup by editing the config-templatebuilder > av-helper-masonry.php file. Look for this code around line 404:
$bg = '<div class="av-masonry-outerimage-container" alt="'.$alt.'">'.$img_before.'<div class="av-masonry-image-container" ' . $img_style . $outer_title . '>' . $img_html . '</div></div>';
.. then replace it with:
$bg = '<div class="av-masonry-outerimage-container">'.$img_before.'<div class="av-masonry-image-container" ' . $img_style . $outer_title . '>' . $img_html . '</div></div>';
Best regards,
IsmaelOctober 1, 2019 at 2:59 pm #1143774Thank you Ismael,
I have done likes you explain. Do you think “alt” tag defines the image in following code?:
<a href="https://www.kazdaglariotel.com/wp-content/uploads/2014/09/site-bahcesi-peyzaj-projesi-06.jpg" id='av-masonry-1-item-1708' data-av-masonry-item='1708' class='av-masonry-entry isotope-item post-1708 attachment type-attachment status-inherit hentry av-masonry-item-with-image av-landscape-img' title="TiTle" itemprop="thumbnailUrl" ><div class='av-inner-masonry-sizer'></div><figure class='av-inner-masonry main_color'><div class="av-masonry-outerimage-container" alt="AlTernative Text"><div class="av-masonry-image-container" style="background-image: url(https://www.kazdaglariotel.com/wp-content/uploads/2014/09/site-bahcesi-peyzaj-projesi-06-705x396.jpg);" title="TiTle" ></div></div><figcaption class='av-inner-masonry-content site-background'><div class='av-inner-masonry-content-pos'><div class='av-inner-masonry-content-pos-content'><div class='avia-arrow'></div><h3 class='av-masonry-entry-title entry-title ' itemprop="headline" >TiTle</h3></div></div></figcaption></figure></a><!--end av-masonry entry-->
When I have tested page with “Alt text tester” chrome extention, it doesn’t show alt text of images expect logo image. I think, “alt” tag should be in first codes after “Title” tag.
For example;
<a href="https://www.kazdaglariotel.com/wp-content/uploads/2014/09/site-bahcesi-peyzaj-projesi-06.jpg" id='av-masonry-1-item-1708' data-av-masonry-item='1708' class='av-masonry-entry isotope-item post-1708 attachment type-attachment status-inherit hentry av-masonry-item-with-image av-landscape-img' title="TiTle" alt="AlTernative Text" itemprop="thumbnailUrl" >
Am I wrong?
October 4, 2019 at 2:25 am #1144806Hi,
Thank you for the update.
There is actually no image tag in that markup because the featured image has been added as the background of the “av-masonry-outerimage-container”. This happens when the Size Settings is set to “fixed”. If you want to apply the alt tag to the parent container, which is a link tag, edit this code around line 438:
$items .= "<{$html_tags[0]} id='av-masonry-".self::$element."-item-".$entry['ID']."' data-av-masonry-item='".$entry['ID']."' class='{$class_string}' {$linktitle} {$markup}>";
Replace it with:
$items .= "<{$html_tags[0]} id='av-masonry-".self::$element."-item-".$entry['ID']."' data-av-masonry-item='".$entry['ID']."' class='{$class_string}' alt='{$alt}' {$linktitle} {$markup}>";
Best regards,
Ismael -
AuthorPosts
- You must be logged in to reply to this topic.