Hi,
I’m using the masonry gallery with customed links. In the gallery print screens are showed from articles. The links lead to the original page of the article. How can I link to a new page so visitors don’t navigate away from the website?
Hey Kim,
Please try adding this at the very end of your themes / child themes functions.php file:
After copying the code please update your domain name in line
jQuery("a[href^='http:']").not("[href*='YOUR-DOMAIN-NAME-HERE.com']").attr('target','_blank');
Best regards,
Vinay
Hi Vinay,
Thanks for your response. I followed your instructions but I get another result. The pages of my main menu open in a different screen, which shouldn’t happen and the links of my masonry gallery still open on the same page.
Hi,
Please replace YOUR-DOMAIN-NAME-HERE.com in Vinay’s code to your website’s link/url.
Best regards,
Nikko
Hi Nikko,
I did this, but it doesn’t work.
Hi!
Can you give us a temporary admin access and ftp access? so we can have a closer look why it’s not functioning as it should. Please place the details in the “private content” section when you reply so only moderators can see.
Regards,
Nikko
of course. thanks
Hi,
We modified the code a bit. Please remove browser cache before checking the page.
Best regards,
Ismael
Hi,
Sorry for the late response, but this one is solved. Thanks a lot!
Hey!
Glad we could help :)
Best regards,
Nikko