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

    Hi, I’ve tried this snippet in docs, but it does not work. The image titles are ever on the mouse over
    Thanks

     <script>
    jQuery(window).load(function(){
    jQuery('#wrap_all a').removeAttr('title');
    jQuery('#wrap_all img').removeAttr('title');
    });
     </script>
    <?php
    }
    add_action('wp_footer', 'remove_title_attr');
    #1033169

    Hey czar,

    The beginning of the code is missing in this snippet, are you using just this?

    Can you give us temporary admin access to your website in the private content box below, so that we can have a closer look?

    Best regards,
    Victoria

    #1033171

    Sorry Victoria, I posted the code badly.

    function remove_title_attr(){
    ?>
     <script>
    jQuery(window).load(function(){
    jQuery('#wrap_all a').removeAttr('title');
    jQuery('#wrap_all img').removeAttr('title');
    });
     </script>
    <?php
    }
    add_action('wp_footer', 'remove_title_attr');

    and it does not work anyway

    • This reply was modified 5 years, 10 months ago by czar.
    #1033584

    Hi czar,

    Can you give us temporary admin access to your website in the private content box below, so that we can have a closer look?

    Best regards,
    Victoria

    #1033593

    Thanks Victoria, token in private data is valid 7 days

    #1034132

    Hi czar,

    Best regards,
    Victoria

    #1034180

    Hi Victoria you’re right, sorry.

    • This reply was modified 5 years, 10 months ago by czar.
    #1035153

    Hi czar,

    I have modified your code in Remove title attributes which you added in Snippets to:

    function remove_title_attr(){
    	?>
    	<script>
    	document.addEventListener("DOMContentLoaded", function(event) {
    		var links = document.querySelectorAll("#wrap_all a"),
    			images = document.querySelectorAll("#wrap_all img");
    
    		[].forEach.call(images, function(image) {
    			image.removeAttribute('title');
    		});
    
    		[].forEach.call(links, function(link) {
    			link.removeAttribute('title');
    		});
    
    
        });
    	</script>
    	<?php
    }
    add_action('wp_footer', 'remove_title_attr');

    Let us know if you need further assistance.

    Best regards,
    Nikko

    #1035174

    Hi Nikko, now work perfecly
    many thanks

    #1035181

    uhmm i have imported this snippet on another site, but not hide title.
    If you want to check there is a token in private data, valid for 7 days
    thanks

    #1035733

    Hi czar,

    Masonry elements are not images or links and so the code does not affect that page. I adjusted the code. Please check.

    Best regards,
    Victoria

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