Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #693569

    Hello,

    I’m using two fullwidth masonry post grids in two difference pages, and for one of them I would like the posts links to open in new windows.
    I added the custom css “masonry-new-windows” to this masonry element but I wasn’t able to find out the right code.

    Can you help me with this please.

    Thanks a lot for your help.

    #693922

    Hey SkinnovationIBK,

    Please add following code to Functions.php file in Appearance > Editor

    function avia_custom_href(){
    ?>
     <script>
    jQuery(window).load(function(){
    jQuery('.masonry-new-windows a').attr('target','_blank');
    });
     </script>
    <?php
    }
    add_action('wp_footer', 'avia_custom_href');

    Best regards,
    Yigit

    #693927

    Hey Yigit, it didn’t work.
    Also I need to do that just in this element, I have another masonry in another page I want it to open normal in the same page.

    #693932

    Hey!

    I edited your page and gave ID to your color section instead and adjusted the code a little. Please review your website now

    Best regards,
    Yigit

    #693936

    It works, thanks a lot for your great support :)

    #693939

    Hey!

    You are welcome, glad we could help :)
    Let us know if you have any other questions or issues and enjoy your weekend!

    Regards,
    Yigit

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Open posts in Masonry element in new windows’ is closed to new replies.