Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #298947

    Our client has requested that we remove all of the ‘tooltips’ that show up with image titles. Do you have a suggestion for removing these, without actually having to remove the “title” elements?

    Site is http://gochronicle.com
    Submitted by Chuck Gregory, developer for Barbara Deckmeyer

    • This topic was modified 10 years, 3 months ago by BarbaraD.
    #298955

    Hey Chuck!

    There is no way to remove the titles without actually remove them. However, i guess you want to keep them for SEO reasons, if that’s the case the following code would be enough as web crawlers don’t run javascript:

    function add_custom_script() { ?>
    <script>
    jQuery(window).load(function(){
    jQuery("img").removeAttr('title');
    });
    </script>
    <?php
    }
    add_action('wp_footer', 'add_custom_script');

    Regards,
    Josue

    • This reply was modified 10 years, 3 months ago by Josue.
    #299131

    Thanks. I added a couple lines at top and created a functions.php in my child theme:
    <?php
    function add_custom_script() { ?>
    <script>
    jQuery(window).load(function(){
    jQuery(“img”).removeAttr(‘title’);
    });
    </script>
    <?php
    }
    add_action(‘wp_footer’, ‘add_custom_script’);

    #299162

    Hey!

    Yes, i forgot that on my initial code. Did it work?

    Cheers!
    Josue

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.