Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #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
    Marc

    #714193

    you 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=””

    #714196

    Hi!

    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,
    Yigit

    #714197

    Hey 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,
    Marc

    #714201

    Ah… 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,
    Marc

    #715286

    Hi,

    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 7 years, 11 months ago by Yigit.
    #716053

    Perfect – Thanks Yigit!

    #716054

    Hi,
    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

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Removing alt text from images’ is closed to new replies.