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.
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
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.
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
It works, thanks a lot for your great support :)