Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #382155

    Hi

    Is there a way, when giving an image in the masonry gallery a custom link, to open it in a new tab rather than the same one?

    Cheers

    #382295

    Hi newsplash!

    Thank you for using Enfold.

    Yes, this is possible. Add this on Quick CSS:

    add_filter('wp_footer', 'avf_gallery_attr', 10);
    function avf_gallery_attr() { ?>
    <script>
    (function($){
        $(window).load(function(){
    		$(".av-masonry-item-with-image").each(function() {
    			$(this).attr("target", "_blank");
    		})	
    	});
    	
    })(jQuery);
    </script>
    <?php
    }

    Regards,
    Ismael

    #382810

    Didn’t work in Quick css but added it to functions.php and worked perfectly. Thanks

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Masonry Gallery custom image links to a new tab’ is closed to new replies.