Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #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.
    #645684
    #645795

    The 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…

    #645810

    Hi,

    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,
    Vinay

    #646026

    Yes, there’s an specific folder

    #646816

    Hey!

    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!
    Josue

    #646824

    I 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');
    #646831

    Glad that worked for you, let us know if you need anything else :)

    Best regards,
    Josue

    #1022436

    This 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

    #1022596

    Hi joax,

    Thanks for the input :-)

    Best regards,
    Rikard

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.