Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #482673

    Hi,

    I see there’s no option inside the Masonry Gallery element to open links in new tabs. Is there a way to change this setting somewhere else in the theme?

    Thanks

    #482678

    Hey 500Webmaster!

    Please turn on custom CSS field for ALB elements – http://kriesi.at/documentation/enfold/turn-on-custom-css-field-for-all-alb-elements/ and give your masonry gallery element a custom CSS class and then add following code to Functions.php file in Appearance > Editor

    function add_custom_target(){
    ?>
    <script>
    jQuery(window).load(function(){
    jQuery('.your-custom-class a').attr('target','_blank');​
    });
    </script>
    <?php
    }
    add_action('wp_footer', 'add_custom_target');

    Best regards,
    Yigit

    #482715

    Hi Yigit,

    Thanks, I managed to add and create Custom CSS field and give the Masonry element a custom name. Then I went back to add the code you gave me to the functions.php document and replaced “your-custom-class” with the name I gave the element, but the links are still opening on the same page.

    I noticed that aside from functions-enfold.php, there’s also theme-functions.php. Either way, I tried the code on both, but it made no difference.

    #482716

    Hi!

    Do you mind creating a temporary admin login and posting it here privately? Please also point out your element with custom class

    Best regards,
    Yigit

    #483292

    Hi, sorry this took so long. We were having issues with our site yesterday. Login details below.

    #483297

    Hi!

    Please change your custom CSS class to “masonry-gallery-custom” and use the code as following

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

    Cheers!
    Yigit

    #483455

    Hi !

    I have the same problem, and I did what you said, but same thing, it does not.
    I managed to add and create Custom CSS field and give the Masonry element a custom name. Then I went back to add the code you gave me to the functions.php document and replaced “your-custom-class” with the name I gave the element, but the links are still opening on the same page.

    Thanks

    Bubarma

    #483511

    Hi Yigit,

    I made the changes you requested as well as updated the file – no change. Although I updated the functions-enfold.php file, not the “Theme Functions” functions.php file. Would that make a difference?

    Thanks

    #483724

    Hey!

    Please give us a link to the page. We will check it. Try to replace the code with this:

    function add_custom_script(){
    ?>
    <script>
      jQuery('.slide-entry a').each(function() {
        jQuery(this).attr('target', '_blank');
      });
    </script>
    <?php
    }
    add_action('wp_footer', 'add_custom_script');

    Replace the “.slide-entry a” with the correct selector.

    Best regards,
    Ismael

    #483769

    Hi Ismael,

    I added the new code as you requested – still no change. Page is: http://siptrunkplus.com/news/10-of-the-best-in-it-and-cloud-humour/

    I did add private login details in one of my earlier replies, maybe you want to login and have a look yourself?

    Best

    • This reply was modified 9 years, 3 months ago by 500Webmaster.
    #484305

    Hey!

    Alright. This should work:

    function add_custom_script(){
    ?>
    <script>
      jQuery('#top .isotope-item').each(function() {
        jQuery(this).attr('target', '_blank');
      });
    </script>
    <?php
    }
    add_action('wp_footer', 'add_custom_script');

    Regards,
    Ismael

    #485783

    Perfect, thank you Ismael!

Viewing 12 posts - 1 through 12 (of 12 total)
  • The topic ‘Masonry Gallery "Open Link In New Tab" Option’ is closed to new replies.