Hi,
I like the custom URL option of masonry gallery items. But, I could not find the option to let the user open the link in a new browser tab. When I click any item, the browser just leaves my page and redirects to the new page. Is there a code snippet to let the clicked item open its specified URL in a new tab?
Thanks.
Hey Serhat!
Please enable the custom css class field: http://kriesi.at/documentation/enfold/turn-on-custom-css-field-for-all-alb-elements/ and then edit your Masonry element and give it a custom CSS class (“my-gallery” in example below) and then add following code to Functions.php file in Appearance > Editor
function av_masonry_target(){
?>
<script>
jQuery(window).load(function(){
jQuery('.my-gallery a').attr('target','_blank');
});
</script>
<?php
}
add_action('wp_footer', 'av_masonry_target');
Best regards,
Yigit
Thank you. It worked :)
Hi,
You are welcome! :)
For your information, you can take a look at Enfold documentation here – http://kriesi.at/documentation/enfold/
And if there are features that you wish Enfold had, you can request them and vote the requested ones here – https://kriesi.at/support/enfold-feature-requests/
For any other questions or issues, feel free to post them here on the forum and we will gladly try to help you :)
Best regards,
Yigit