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.
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
okay i added that – then what?
Hey!
It should have worked. Do you mind creating a temporary admin login and posting it here privately?
Cheers!
Yigit
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…
Hi!
Please go to YOURDOMAIN.org/publications/audio-publications/ and click on portfolio items
Best regards,
Yigit
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
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