Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #624703

    Hi, quick question:
    Is there a quick CSS I can use to open the Masonry Gallery Custom Link in a new Tab/Window ?

    Many thanks,
    H

    #624742

    Hey Heathcliffe,

    There is no CSS to do that, but u can do it with some Jquery.
    You can use the following, by changing the id with the mansory ID

    $(‘a#link_id’).click(function() {
    $(this).attr(‘target’, ‘_blank’);
    });

    let us know if that helps you out

    Best regards,
    Basilis

    #624809

    @basilis

    Many thanks for the quick reply and the solution. I’m not a coder. Where do I add this code?

    Thanks,
    H

    #626149

    Hi,

    Sorry for the delay. You can add the code in the functions.php file:

    // new script
    add_action('wp_footer', 'ava_new_custom_script_masonry');
    function ava_new_custom_script_masonry(){
    ?>
    <script type="text/javascript">
    (function($) {
    	function e() {
    		$('.av-masonry-gallery').each(function() {
    			$(this).find('.av-masonry-entry').attr('target', '_blank');
    		});	
    	}
       
       	e();
    })(jQuery);
    </script>
    <?php
    }

    Best regards,
    Ismael

    #627284

    Thanks guys,
    I managed to create a child theme and put this in functions.php and it works fine.

    Much appreciated.

    #628071

    Hi,

    Great, glad we could help :-)

    Cheers!
    Rikard

    #1230966

    Hello,

    I also want my Masonry Gallery to be able to open a new window. I have pasted the code in Function.php but nothing changes. The current environment page is: http://www.designplanung.com/projekt-068/
    Do I have to change the page as a child theme? What could be the problem? I use the latest WordPress and Enfold 4.7.4.

    Best regards,
    Martin

    #1231212

    Hi Martin,

    There are errors in your JavaScript.

    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

    #1233506

    Hello Victoria,

    how do i do it again?

    #1233834

    Hi Martin,

    You can create a new user with admin rights, then post the login details here in private.

    Best regards,
    Rikard

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