-
AuthorPosts
-
June 27, 2019 at 5:50 pm #1114041
Hello,
I’m using the masonry element to display blog posts and I was wondering if there was a way to make these posts open up in a new tab. Thanks!
June 30, 2019 at 1:32 am #1114546Hey bobfurgo,
Sorry for the late reply, we could do this with some javascript but we will need to see the page to examine the sectors.
Right now the page requires a login to view.Best regards,
MikeJuly 1, 2019 at 4:14 pm #1114915Hi Mike, thanks for your reply. Please see private area for login details. Thanks!
July 3, 2019 at 4:58 pm #1115516Hello, just following up on this. Thanks!
July 3, 2019 at 7:58 pm #1115551Hi bobfurgo,
Best regards,
VictoriaJuly 3, 2019 at 8:54 pm #1115578Sorry about that! See private area
July 4, 2019 at 8:19 pm #1115881Hi bobfurgo,
Here is the code you can put in your funtions.php
function av_add_attribute() { ?> <script type="text/javascript"> (function($) { $(window).load(function() { $('.home #av-masonry-1 .av-masonry-entry.isotope-item').attr('target', '_blank'); }); })(jQuery); </script> <?php } add_action('wp_footer', 'av_add_attribute');
If you need further assistance please let us know.
Best regards,
Victoria- This reply was modified 5 years, 5 months ago by Victoria.
July 25, 2019 at 5:25 pm #1121951Hi Victoria!
I’ve put that code into the child theme’s functions.php but the blog post links still aren’t opening in a new tab. Could you please help with this? Thanks so much!
July 27, 2019 at 9:19 pm #1122437Hi,
Sorry for the late reply, I took a look at your site and found that your jQuery was giving this error:jQuery is not defined
Typically this is due to one of your plugins is conflicting with other plugins, or
JavaScript runs before the page is fully loaded in turn before the jQuery is fully loaded, or
CDN-hosted jQuery might be blocked or down.
I ended up correcting the error by adding this to your functions.phpfunction av_add_jquery() { ?> <script src="https://code.jquery.com/jquery-1.11.2.min.js" type="text/javascript"></script> <?php } add_action('wp_head', 'av_add_jquery');
Now your posts are opening in a new tab, please clear your browser cache and check.
Best regards,
MikeAugust 13, 2019 at 4:47 pm #1127286Hi Mike! Sorry for the delayed reply and thanks so much for your efforts and prompt responses. However I checked in an incognito and cleared my cookies, looks like the blog posts are still opening in the same tab unfortunately.
August 14, 2019 at 6:44 am #1127493Hi,
Sorry, I tested again in incognito with a clear cache, but the masonry is opening in new tabs for me. Please see the video in Private Content area.Best regards,
MikeAugust 14, 2019 at 10:38 pm #1127760You’re awesome Mike! Thank you!
August 15, 2019 at 7:27 am #1127837Hi,
Glad we were able to help, we will close this now. Thank you for using Enfold.For your information, you can take a look at Enfold documentation here
For any other questions or issues, feel free to start new threads in the Enfold forum and we will gladly try to help you :)Best regards,
Mike -
AuthorPosts
- The topic ‘Blog posts displayed in Masonry element open up in new tab?’ is closed to new replies.