-
AuthorPosts
-
June 9, 2016 at 5:50 pm #645596
On a portfolio item you can specify an external url to open. How to make that link open in new window? (Almost everywhere else you can set this behavior)
- This topic was modified 8 years, 5 months ago by Desire.
June 9, 2016 at 7:44 pm #645684Hey Desire,
Refer to:
https://kriesi.at/support/topic/portfolio-external-links-on-new-tab-or-window/#post-272601Best regards,
JosueJune 9, 2016 at 10:18 pm #645795The external links are on the same domain (out of WP), your solution does not work.
Already tried in /enfold/config-templatebuilder/avia-shortcodes/portfolio.php
Changing
492$output .= "<".$link_markup[0]." data-rel='grid-".avia_post_grid::$grid."' class='grid-image avia-hover-fx'>".$custom_overlay.$image."</".$link_markup[1].">";
506
$output .= "<".$link_markup[0]." data-rel='grid-".avia_post_grid::$grid."' class='grid-image avia-hover-fx'>".$custom_overlay.get_the_post_thumbnail( $the_id, $image_size, $image_attrs )."</".$link_markup[1].">";
to
492$output .= "<".$link_markup[0]." target='_blank' data-rel='grid-".avia_post_grid::$grid."' class='grid-image avia-hover-fx'>".$custom_overlay.$image."</".$link_markup[1].">";
506
$output .= "<".$link_markup[0]." target='_blank' data-rel='grid-".avia_post_grid::$grid."' class='grid-image avia-hover-fx'>".$custom_overlay.get_the_post_thumbnail( $the_id, $image_size, $image_attrs )."</".$link_markup[1].">";
But that’s ignored…
June 9, 2016 at 10:47 pm #645810Hi,
If the links that you want to open in a new window starts with a common URL example mydomain.com/mycat/portfolio-item-1 we can work around this let us know about the catogery or the common URL part. if not it is not possible to distinguish the URL’s if it is starting from the same domain :/
Best regards,
VinayJune 10, 2016 at 5:54 am #646026Yes, there’s an specific folder
June 12, 2016 at 10:26 am #646816Hey!
Try adding this at the very end of your theme / child theme functions.php file:
function add_custom_script(){ ?> <script> jQuery(window).load(function(){ jQuery("a[href^='/panos/']").attr('target','_blank'); }); </script> <?php } add_action('wp_footer', 'add_custom_script');
Cheers!
JosueJune 12, 2016 at 10:55 am #646824I found this to work:
function add_custom_port_target(){ ?> <script> jQuery(window).load(function(){ jQuery('a.grid-image').attr('target','_blank'); }); </script> <?php } add_action('wp_footer', 'add_custom_port_target');
June 12, 2016 at 11:02 am #646831Glad that worked for you, let us know if you need anything else :)
Best regards,
JosueOctober 16, 2018 at 11:03 pm #1022436This whole thing is freaking lame peoples.. which person on earth wants links to another domain opening in the same window.. that’s right.. no body :-P
October 17, 2018 at 7:52 am #1022596 -
AuthorPosts
- You must be logged in to reply to this topic.