-
AuthorPosts
-
January 7, 2026 at 1:04 pm #1493688
ThorstenFB
GuestHi,
to open portfolio links in a new tab, I followed the instructions here: https://kriesi.at/support/topic/portfolio-custom-link-target_blank/#post-715795
This works quite well so far. But portfolio entries that are loaded afterward (via the “load more” button) are still opened in the same tab.
I would therefore appreciate your help.
Thanks a lot!Thorsten
January 8, 2026 at 10:34 am #1493707Hey ThorstenFB,
Thank you for the inquiry.
Try to add this code to the functions.php file to re-apply the target attribute to the loaded portfolio items.
add_action('wp_footer', function () { ?> <script> jQuery(function ($) { function applyMasonryTargetBlank() { setTimeout(function () { $('.av-masonry-entry a').attr('target', '_blank'); }, 500); } applyMasonryTargetBlank(); $(window).on('debouncedresize', function () { applyMasonryTargetBlank(); }); }); </script> <?php }, 9999);Best regards,
IsmaelJanuary 8, 2026 at 10:54 am #1493711Hi Ismael,
thanks for your help. Unfortunately this isn’t working on my site (see private content).
Do you have an idea to resolve?Thanks a lot
ThorstenJanuary 9, 2026 at 6:17 am #1493756Hi,
Thank you for the update.
It seems to be working when we tested it on our end. Please try to increase the timeout from 500 ms to 1000 ms or longer. If you can provide the login details in the private field, we’ll check the script further.
Best regards,
IsmaelJanuary 9, 2026 at 9:59 am #1493766HI Ismael,
thanks again for your help!
I changed the timeout but the problem still exists.
You see the login details in the private content.Best regards,
ThorstenJanuary 9, 2026 at 11:38 am #1493770This reply has been marked as private. -
AuthorPosts
- You must be logged in to reply to this topic.
