Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1009467

    Hi there,

    I saw some posts about this topic and I tried to solve the problem on my website (in masonry click on image and open an external link).
    Unfortunately I did not succeed.

    Can I send you my login of my website and can you add the neccesary code?
    Thanks a lot in advance.

    Cecile

    #1009558

    Hey Dijkhuis,

    It opens in a lightbox, why do you need to open images in the new tab?

    Best regards,
    Victoria

    #1009602

    Yes please.
    Thank you very much.

    #1009616

    Hi,

    So you don’t want the lightbox?

    Best regards,
    Jordan Shannon

    #1010237

    Hi Jordan,

    That’s right. I don’t want a lightbox but to open a url in a new tab.
    In have a B&B and in this masonry I for instance refer to a bike shop to rent bikes.
    If you click on the image in the masonry a the bikshop needs to open in a new tab.

    Thanks! Cecile

    #1010337

    Hi Cecile,

    You can disable the lightbox in the theme options.
    Image 2018-09-16 at 11.22.15.png

    Or in the masonry settings choose not to open images in lightbox, choose the other option.

    Best regards,
    Victoria

    #1010444

    Hi Victoria,

    I know all that. My question is how to open the link in a NEW tab. Check also the title of my post.

    Please help me with this. Hope to hear from you soon.

    Regards, Cecile

    #1010466

    Hi Cecile,

    We don’t have the option to manually select which image should open in new tab, however we can give you a code to open it all new tab.
    Just add this code at the bottom of your functions.php:

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

    Best regards,
    Nikko

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