Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #802638

    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.

    #802643

    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

    • This reply was modified 6 years, 10 months ago by Yigit.
    #802919

    Thank you. It worked :)

    #802998

    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

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Masonry Gallery Custom URL Link in New Tab?’ is closed to new replies.