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

    hey there,

    i want to use the masonry gallery with linktarget “blank” just on one site (“Home”)
    i found the snippet to use it for the child functions.php.
    but the target in the masonry galleries on the other sites should be stay by default (same tab)

    is there a solution?

    #526112

    Hi volmering!

    Please add following code to Functions.php file in Appearance > Editor

    function add_custom_target(){
    ?>
    <script>
    jQuery(window).load(function(){
    jQuery('.home .av-masonry a').attr('target','_blank');
    });
    </script>
    <?php
    }
    add_action('wp_footer', 'add_custom_target');

    Cheers!
    Yigit

    #526117

    man, that was the quickest answer ever!!!!! thx alot :-)
    great job

    • This reply was modified 9 years ago by volmering.
    #526123

    Hi!

    There has been quicker ones on this forum but thanks, we are trying ;D

    You are welcome, glad we could help! Let us know if you have any other questions or issues

    Cheers!
    Yigit

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘masonry gallery image link target’ is closed to new replies.