Tagged: links, Masonry Gallery
-
AuthorPosts
-
August 4, 2015 at 2:04 pm #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
August 4, 2015 at 2:14 pm #482678Hey 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,
YigitAugust 4, 2015 at 2:52 pm #482715Hi 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.
August 4, 2015 at 2:54 pm #482716Hi!
Do you mind creating a temporary admin login and posting it here privately? Please also point out your element with custom class
Best regards,
YigitAugust 5, 2015 at 1:26 pm #483292Hi, sorry this took so long. We were having issues with our site yesterday. Login details below.
August 5, 2015 at 1:31 pm #483297Hi!
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!
YigitAugust 5, 2015 at 4:14 pm #483455Hi !
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
August 5, 2015 at 5:49 pm #483511Hi 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
August 6, 2015 at 8:26 am #483724Hey!
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,
IsmaelAugust 6, 2015 at 10:32 am #483769Hi 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, 4 months ago by 500Webmaster.
August 7, 2015 at 7:27 am #484305Hey!
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,
IsmaelAugust 11, 2015 at 9:27 am #485783Perfect, thank you Ismael!
-
AuthorPosts
- The topic ‘Masonry Gallery "Open Link In New Tab" Option’ is closed to new replies.