-
AuthorPosts
-
September 28, 2014 at 5:55 am #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.
September 29, 2014 at 7:36 pm #326753Hey 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,
YigitSeptember 29, 2014 at 8:39 pm #326795okay i added that – then what?
September 30, 2014 at 12:53 pm #327144Hey!
It should have worked. Do you mind creating a temporary admin login and posting it here privately?
Cheers!
YigitSeptember 30, 2014 at 1:56 pm #327205This reply has been marked as private.September 30, 2014 at 2:03 pm #327213September 30, 2014 at 3:04 pm #327279Yigit,
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…
September 30, 2014 at 3:17 pm #327290Hi!
Please go to YOURDOMAIN.org/publications/audio-publications/ and click on portfolio items
Best regards,
YigitSeptember 30, 2014 at 4:15 pm #327378cool – 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
October 1, 2014 at 7:09 am #327882Hey!
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 -
AuthorPosts
- The topic ‘Portfolio Custom Link – Open in New Tab’ is closed to new replies.
