• Resolved deputy05

    (@deputy05)


    Is there any way to suppress all link titles globally? Or do I have to suppress each one individually?

    Thank you.

Viewing 9 replies - 1 through 9 (of 9 total)
  • Can you explain a little more, and website link would help.

    Simple answer is YES, if I understand exactly what you’re trying to do

    Thread Starter deputy05

    (@deputy05)

    I am trying to suppress the link titles on mouse hover for the site logo, social icons, and breadcrumbs.

    I modified this snippet:
    https://www.themesandco.com/snippet/changing-social-links-titles-displayed-mouse-hover/
    for the social icons, but am struggling to come up with the proper filter arguments for the others.

    I am extremely new to this and am trying to learn via Customizr website and other online resources.

    My website (in it’s early stages) can be found here.

    Thank you!

    Site is looking good!

    Before I confuse you, what is it about the hover state styling that you don’t like? What behaviour are you looking to replace current styling with?

    I don’t really understand what you mean by ‘suppress the link titles’

    Ah, I see what you’re trying to do. Simply suppress the hover text (tooltip)?

    Can’t be done in CSS, needs Javascript

    $('a["title"]').on('mouseenter', function(e){
        e.preventDefault();
    });

    I’ll produce a snippet for this

    Thread Starter deputy05

    (@deputy05)

    Yes…exactly…sorry about poor terminology.

    Thank you very much!

    Before I publish a Snippet, perhaps you’d like to test this:

    Assuming you have a Child Theme, add this to your functions.php:

    add_action('wp_footer', 'rdc_suppress_tooltips');
    function rdc_suppress_tooltips(){
    ?>
    <script type="text/javascript">
    	jQuery(document).ready(function ($) {
    
     	$("a[title]").hover(function(){
    
        // Get the current title
        var title = $(this).attr("title");
    
        // Store it in a temporary attribute
        $(this).attr("tmp_title", title);
    
        // Set the title to nothing so we don't see the tooltips
        $(this).attr("title","");
        },
    
        function() { // Fired when we leave the element
    
        // Retrieve the title from the temporary attribute
        var title = $(this).attr("tmp_title");
    
        // Return the title to what it was
        $(this).attr("title", title);
        });
    
       //Restore the title on click
        $("a[title]").click(function(){
    
       // Retrieve the title from the temporary attribute
        var title = $(this).attr("tmp_title");
    
        // Return the title to what it was
        $(this).attr("title", title);
        });
    		});
    </script>
    <?php
    }

    (With help from Rocco@d4z!)

    Thread Starter deputy05

    (@deputy05)

    Thanks again…
    I will give it try and let you know.

    Thread Starter deputy05

    (@deputy05)

    Beautiful…it appears to do the job…
    Cannot thank you enough. Such wonderful support on a wonderful theme.
    ??

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Suppress link titles globally?’ is closed to new replies.