Tagged: custom link, Masonry Gallery, target blank
-
AuthorPosts
-
April 29, 2016 at 6:45 pm #624703
Hi, quick question:
Is there a quick CSS I can use to open the Masonry Gallery Custom Link in a new Tab/Window ?Many thanks,
HApril 29, 2016 at 7:58 pm #624742Hey Heathcliffe,
There is no CSS to do that, but u can do it with some Jquery.
You can use the following, by changing the id with the mansory ID$(‘a#link_id’).click(function() {
$(this).attr(‘target’, ‘_blank’);
});let us know if that helps you out
Best regards,
BasilisApril 29, 2016 at 10:18 pm #624809Many thanks for the quick reply and the solution. I’m not a coder. Where do I add this code?
Thanks,
HMay 3, 2016 at 4:38 am #626149Hi,
Sorry for the delay. You can add the code in the functions.php file:
// new script add_action('wp_footer', 'ava_new_custom_script_masonry'); function ava_new_custom_script_masonry(){ ?> <script type="text/javascript"> (function($) { function e() { $('.av-masonry-gallery').each(function() { $(this).find('.av-masonry-entry').attr('target', '_blank'); }); } e(); })(jQuery); </script> <?php }Best regards,
IsmaelMay 4, 2016 at 3:16 pm #627284Thanks guys,
I managed to create a child theme and put this in functions.php and it works fine.Much appreciated.
May 6, 2016 at 5:04 am #628071July 16, 2020 at 4:21 pm #1230966Hello,
I also want my Masonry Gallery to be able to open a new window. I have pasted the code in Function.php but nothing changes. The current environment page is: http://www.designplanung.com/projekt-068/
Do I have to change the page as a child theme? What could be the problem? I use the latest WordPress and Enfold 4.7.4.Best regards,
MartinJuly 17, 2020 at 12:07 pm #1231212Hi Martin,
There are errors in your JavaScript.
Can you give us temporary admin access to your website in the private content box below, so that we can have a closer look?
Best regards,
VictoriaJuly 27, 2020 at 12:46 pm #1233506Hello Victoria,
how do i do it again?
July 29, 2020 at 4:42 am #1233834 -
AuthorPosts
- You must be logged in to reply to this topic.
