Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #326077

    I have a unique situation – in which I am using portfolio to link to another page within my site. And another situation where i am using them to link to another webpage outside my site.

    Is there an ability to control, if the user is taken to a new tab or not? Currently, when using the custom link feature, it opens on the same tab, and that is find for one thing — but for the other i would like to open in a new tab. Please see private content section.

    #326753

    Hey ojasray!

    Please add following code to Functions.php file in Appearance > Editor

    function add_custom_port_target(){
    ?>
    <script>
    jQuery(window).load(function(){
    jQuery('.page-id-3396 .main.content a').attr('target','_blank');
    });
    </script>
    <?php
    }
    add_action('wp_footer', 'add_custom_port_target');
    

    Best regards,
    Yigit

    #326795

    okay i added that – then what?

    #327144

    Hey!

    It should have worked. Do you mind creating a temporary admin login and posting it here privately?

    Cheers!
    Yigit

    #327205
    This reply has been marked as private.
    #327213

    Hi!

    Please review your website now.

    Best regards,
    Yigit

    #327279

    Yigit,

    thank you for your help – but am i specifically looking at? when i go to that site, it still opens in same tab. and when i open up the portfolio – i am not sure where the option is to set new tab…

    #327290

    Hi!

    Please go to YOURDOMAIN.org/publications/audio-publications/ and click on portfolio items

    Best regards,
    Yigit

    #327378

    cool – i see it now. so basically in the function code that you provided – you found the page id, and all the link on that page will open in new tab?

    is there way to add a option to specific portfolio category? if not then this will be fine for now…i have submitted a feature request – as i think this will benefit a lot of people.

    thanks

    #327882

    Hey!

    Yes, that is the purpose of the code. Unfortunately, it’s not possible to filter by category without major modifications on the script. . Please visit Envato Studio or Werkpress for further customization.

    Best regards,
    Ismael

Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘Portfolio Custom Link – Open in New Tab’ is closed to new replies.