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
Hey Dijkhuis,
It opens in a lightbox, why do you need to open images in the new tab?
Best regards,
Victoria
Yes please.
Thank you very much.
Hi,
So you don’t want the lightbox?
Best regards,
Jordan Shannon
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
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
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