Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #870894

    I’ve set up an portfolio with team members. When I hover the featured image, i see in the alt text the complete title. Actually I want to see nothing when hovering that image. Is that possible?

    #870900

    Hey martinvanderharst,

    Try adding this code to the footer.php file:

    <script type="text/javascript">
    /* The first line waits until the page has finished to load and is ready to manipulate */
    $(document).ready(function(){
        /* remove the 'title' attribute of all <img /> tags */
        $("img").removeAttr("title");
    });
    </script>

    Best regards,
    Jordan Shannon

    #871639

    Tried this, but no succes. See this screenshot:
    screencapture

    #871758

    Hi,

    Try adding it to functions.php instead:

    
    function add_custom_code(){
    <script type="text/javascript">
    
    /* The first line waits until the page has finished to load and is ready to manipulate */
    JQuery(document).ready(function(){
        /* remove the 'title' attribute of all <img /> tags */
        JQuery("img").removeAttr("title");
    });}
    add_action('wp_footer', 'add_custom_code');

    Best regards,
    Jordan Shannon

    #871858

    gives me a white screen and no active website at all !

    #871914

    Hi,

    Apologies, if possible if you can access the functions.php file via ftp or cpanel you can remove the code above to restore the site.

    Best regards,
    Jordan Shannon

    #873117

    Any other options to remove the alt text?

    #873128
    #873132

    i think it was the function name – with the white screen
    you have to prove always if you have used it allready. If a function name is there twice it ends up in a white screen.

    by the way – have a look to your team member page: https://kriesi.at/themes/enfold-2017/elements/team-member/

    do you see images – i guess they have the test.kriesi.at link in it ( thats the past)

    by the way – i don’t like file names too – there is a fix to show the description instead :
    on galleries or images:

    function gallery_title_fix(){
    ?>
    <script>
    (function($){
        $(window).load(function() {
          $('.lightbox-added img').each(function(){
                var lin = $(this).attr('alt');
                $(this).attr('title',lin);
            });
        });
    })(jQuery);
    </script>
    <?php
    }
    add_action('wp_footer', 'gallery_title_fix');
    #873145

    Okay, now it’s working. Thank you for the support.

    #873162

    Hi,

    I’m glad you were able to get this corrected. If you need additional help, please let us know here in the forums.

    Best regards,
    Jordan Shannon

Viewing 11 posts - 1 through 11 (of 11 total)
  • The topic ‘remove alt text when hovering portfolio image’ is closed to new replies.