Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #748412

    I want to be able to open all images across the site (except logo of course) to open in a new tab. Our SEO consultant says it would be better. Is there a piece of code i can use? Thnaks in advance guys. I love Enfold!

    #750319

    Hey anushikababuv!

    Thank you for using Enfold.

    I’m not sure of its advantage but if you really want to do it, first, you have to disable the Lightbox Modal Window option in the Enfold > Theme Options panel then add this code in the functions.php file:

    function ava_custom_script_mod(){
    ?>
    <script>
    (function($){
    	function a() {
    		$('a[href$=jpg], a[href$=png], a[href$=gif], a[href$=jpeg], a[href*=".jpg?"], a[href*=".png?"], a[href*=".gif?"], a[href*=".jpeg?"]').attr('target', '_blank');
    	}
    
    	a();
    })(jQuery);
    </script>
    <?php
    }
    add_action('wp_footer', 'ava_custom_script_mod');

    Regards,
    Ismael

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