-
AuthorPosts
-
July 24, 2016 at 2:00 am #664270
See the page link below. Click the first portfolio item, PWM. The link actually goes to a different site, and I need for this to open in a new window/tab. In “Portfolio Items”, under the “Additional Portfolio Settings”, I have the “Overwrite Portfolio Link” setting set to “Define Custom Link”, and then I have the link pasted in to the “Link portfolio item to external URL” field. Though, there is no option in the interface to have this link open in a new window/tab. How can I accomplish this?
http://66.147.242.174/~lsiairli/outdoor/
Thanks for your help in advance
July 24, 2016 at 9:19 am #664295sorry – as a participant as you are i can not help you because i don’t see the site – “Password protected”
i think there is a Password in the hidden part of the thread here so you have to wait on Mods.July 25, 2016 at 11:57 pm #664953Hi,
Please enable the custom css class field: http://kriesi.at/documentation/enfold/turn-on-custom-css-field-for-all-alb-elements/ and then edit your portfolio grid element and give it a custom CSS class then add following code to Functions.php file of your child theme in Appearance > Editor
function av_portfolio_new_tab(){ ?> <script> jQuery(window).load(function(){ jQuery('.your-custom-class a').attr('target','_blank'); }); </script> <?php } add_action('wp_footer', 'av_portfolio_new_tab');
Best regards,
YigitSeptember 20, 2016 at 2:53 pm #689275^UPVOTE, finally found the right solution. Thanks!
September 20, 2016 at 2:55 pm #689279Hi,
Glad it worked for you! :)
We will keep the thread open and will wait to hear from the creator of this thread. If you have any other questions or issues, please feel free to start a new thread.
Best regards,
YigitOctober 21, 2016 at 11:26 am #702304Hello
please add this setting in next updates : select menu : target for same window or new window above field Link portfolio item to external URL
it will be helpfull
have a nice dayOctober 21, 2016 at 3:14 pm #702451Hi,
Please feel free to request – or vote if already requested – such feature on Enfold feature request form.
Best regards,
YigitAugust 18, 2017 at 1:28 am #840690Hi Yigit,
I tried to follow your instructions but my portfolio links still open in the same window.Here’s what I have done:
Via Filezilla I accessed the functions.php file (wp-content/themes/enfold) and have edited it in Dreamweaver: I have added the following underneath the code that was there:add_theme_support(‘avia_template_builder_custom_css’);
and saved it to replace the functions.php file.
I then opened my portfolio page and clicked on the Portfolio Grid.
Under Custom Css Class I wrote in cr-portfolionewtab and clicked save.In Appearance > Editor I selected the functions.php file in the Enfold theme.
Then copied the following code to the bottom of the code that was there:
function av_portfolio_new_tab(){
?>
<script>
jQuery(window).load(function(){
jQuery(‘.cr-portfolionewtab a’).attr(‘target’,’_blank’);
});
</script>
<?php
}
add_action(‘wp_footer’, ‘av_portfolio_new_tab’);But all links are still opening in the same window.
Thanks for your help!
Carolin- This reply was modified 7 years, 4 months ago by messmeriza.
August 19, 2017 at 8:17 pm #841394Hi Carolin,
Here is the code you can put in your funtions.php
function av_portfolio_new_tab() { ?> <script> jQuery(window).load(function() { jQuery('.grid-image').attr('target','_blank'); }); </script> <?php } add_action('wp_footer', 'av_portfolio_new_tab');
If you need further assistance please let us know.
Best regards,
VictoriaAugust 21, 2017 at 11:24 pm #842266Thanks Victoria! It works :)
August 22, 2017 at 12:43 pm #842481Hi messmeriza,
Glad you we it working for you! :)
If you need further assistance please let us know.
Best regards,
VictoriaJanuary 23, 2019 at 11:19 pm #1057968Hi there,
This works great for me – except it opens internal as well as external links in a new tab/window. I only want external links in my portfolio grid to open in a new tab/window – not links to other post/pages within the site.
Is there any way the code can accommodate this?
Thanks,
JasonJanuary 24, 2019 at 5:44 pm #1058247Hi Jason,
Well, your class selector in the script has to be specific just for the portfolio pages. Do you need help with that?
Best regards,
VictoriaApril 19, 2021 at 9:58 am #1295194Hi,
I put this code in function.php of my chidthemefunction av_portfolio_new_tab() { ?> <script> jQuery(window).load(function() { jQuery('.grid-image').attr('target','_blank'); }); </script> <?php } add_action('wp_footer', 'av_portfolio_new_tab');
and I give the av_portfolio_new_tab class to the portfolio grid, but don’t open a news window.
What can i do?
April 21, 2021 at 5:41 am #1295670Hi sere,
Can you give us the link for the page where this is supposed to work? so we can check if there are any js errors preventing it from working.
Best regards,
NikkoSeptember 1, 2021 at 8:40 pm #1319394This reply has been marked as private.September 2, 2021 at 5:12 pm #1319537Never mind I figured it out. Thank you!
September 3, 2021 at 6:58 am #1319607Hi SandraSquires,
Great, I’m glad that you figured it out, and thanks for the update :-)
Best regards,
RikardSeptember 30, 2021 at 3:21 pm #1323028I had this working but now it is not. Can you help with it?
September 30, 2021 at 3:55 pm #1323034Hey,
I edited your Porfolio Grid elements and gave them “blank-target” ID in Advanced > Developer Settings and then changed your code in functions.php file to following one
function av_portfolio_new_tab() { ?> <script> jQuery(window).load(function() { jQuery('#blank-target .grid-image').attr('target','_blank'); }); </script> <?php } add_action('wp_footer', 'av_portfolio_new_tab');
Please review your website :)
Regards,
YigitSeptember 30, 2021 at 4:04 pm #1323042Thank you for your help!
September 30, 2021 at 4:13 pm #1323044 -
AuthorPosts
- The topic ‘Portfolio item links need to open in new browser window’ is closed to new replies.