Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #587267

    Hi,

    I already posted this issue in a different post: https://kriesi.at/support/topic/remove-image-titles-hover-on-images-conflict/

    I am using the following code:

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

    However, these tags are still showing up in some other parts of the website.
    How to disable them across all images in all parts of the website?
    If possible, please add the full code to replace the one above.
    Please check the page in PVT

    #588139

    Hey sitesme!

    Thank you for using Enfold.

    Please replace it with this:

    // remove img title
    add_action('wp_footer', 'ava_custom_script_title');
    function ava_custom_script_title(){
    ?>
    <script type="text/javascript">
    (function($) {
        $('img').removeAttr('title');
    })(jQuery);
    </script>
    <?php
    }
    

    Best regards,
    Ismael

    #590740

    Unfortunately the title tags are still showing up. Please check the page in PVT.

    I have this in my functions.php file, can I remove all this and get just one single code that removes all the tags from all parts of the website when mouse hover?

    function add_custom_script(){
    ?>
    <script>
    jQuery(window).load(function(){
    	jQuery('img').removeAttr('title');       
    });
    </script>
    <?php
    }
    add_action('wp_footer', 'add_custom_script');
    
    // remove img title
    add_action('wp_footer', 'ava_custom_script_title');
    function ava_custom_script_title(){
    ?>
    <script type="text/javascript">
    (function($) {
        $('img').removeAttr('title');
    })(jQuery);
    </script>
    <?php
    }
    #590746

    Hi!

    Do you mind creating a temporary admin login and posting it here privately?

    Best regards,
    Yigit

    #592488

    Hi Yigit,

    I am a bit confused with the amount of code on functions.php and would prefer to start from scratch.

    Could you please tell me a code that will replace all the previous code I added in the past, to simply hide all alt / meta tags from all images throughout the whole theme on mouse hover? This means in all images from galleries, slideshows and regular images.

    Many thanks

    #594097

    Hi Yigit,

    Please find the temporary access to a demo WP account below.
    When mouse is hover the images, it shows the image meta name. We would like to hide all from all pictures / galleries, etc.

    Thank you

    #595376

    Hi!

    Alright. We modified the code a bit. Please check the page now.

    Cheers!
    Ismael

    • This reply was modified 8 years, 8 months ago by Josue.
    #595387

    Hi Ismael,

    Thank you.

    Please check my message in PVT and also confirm what was changed exactly? Only the functions.php file with all this code?

    // remove img title
    add_action('wp_footer', 'ava_custom_script_title');
    function ava_custom_script_title(){
    ?>
    <script type="text/javascript">
    (function($) {
        $('img').removeAttr('title');
        var a = function() {
    		$('.avia-gallery-thumb a').each(function() {
    			$(this).removeAttr('title');
    		});
    	}
    
        a();
    })(jQuery);
    </script>
    <?php
    }
    #597507

    Links are removed now, and yes that’s the correct code.

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