-
AuthorPosts
-
November 18, 2016 at 10:09 pm #714192
Hi Guys,
I need some help please. I’ve added the code below to my functions.php file to remove the alt text on images but this isn’t working for me on my live site. Strangely it is on my dev site – any ideas? Btw I have cleared both my browser cache and WP Super Cache without success.
function remove_title_attr(){ ?> <script> jQuery(window).load(function(){ jQuery('a').removeAttr('title'); jQuery('img').removeAttr('title'); }); </script> <?php } add_action('wp_footer', 'remove_title_attr');
Thanks
MarcNovember 18, 2016 at 10:20 pm #714193you want to remove the alt text only or to remove the tag ?
because on coming WordPress 4.7 the alt tag stays empty if there is no text input for it than the tag is alt=””November 18, 2016 at 10:27 pm #714196Hi!
Please try de-activating Autoptimize plugin and check if that helps. If it does, please adjust its options and flush cache and it should work. If it does not, please create a temporary admin login and post it here privately :)
@guenni007 Thanks for your input :)Regards,
YigitNovember 18, 2016 at 10:28 pm #714197Hey Guenni007,
I was just looking at removing the popup text that you get from hovering over an image. Not too sure what I’ve done but it’s just kicked in and seems to be working (ie the popup text is now gone).
I am guessing for SEO purposes there should be both a title and alternative text added?
Thanks,
MarcNovember 18, 2016 at 10:40 pm #714201Ah… ok I thought it was working but…
When you click on load more the alt tags re-appear however the images in the first section don’t have them displayed. Confused to say the least!
I’ve tried as Yigit suggests and that didn’t seem to work so have created a login for you.
Thanks for your help,
MarcNovember 22, 2016 at 1:09 pm #715286Hi,
Please go to enfold/config-templatebuilder/avia-shortcodes/av-helper-masonry.php file and find
$img_html = '<img src="'.$attachment[0].'" title="'.$title.'" alt="'.$alt.'" />';
and change it to
$img_html = '<img src="'.$attachment[0].'" alt="'.$alt.'" />';
Please consider using a child theme – http://kriesi.at/documentation/enfold/using-a-child-theme/ to avoid applying the same changes each time you update the theme and see – http://kriesi.at/documentation/enfold/add-new-or-replace-advanced-layout-builder-elements-from-child-theme/
Best regards,
Yigit- This reply was modified 8 years, 1 month ago by Yigit.
November 23, 2016 at 5:00 pm #716053Perfect – Thanks Yigit!
November 23, 2016 at 5:04 pm #716054Hi,
You are welcome!For your information, you can take a look at Enfold documentation here – http://kriesi.at/documentation/enfold/
And if there are features that you wish Enfold had, you can request them and vote the requested ones here – https://kriesi.at/support/enfold-feature-requests/
For any other questions or issues, feel free to post them here on the forum and we will gladly try to help you :)Regards,
Yigit -
AuthorPosts
- The topic ‘Removing alt text from images’ is closed to new replies.