Tagged: external links, portfolio items
Hi Kriesi,
I added this code to functions.php to open external links in new tab. I need this basically for the portfolio. It works perfect but the problem appears when I click on the “load more button”. Then the new items don´t open in new tab.
I think that the code is already executed and it doesn’t work with the new loaded items.
Any idea about how can I solve this?
function add_custom_script(){
?>
<script>
jQuery(window).load(function(){
jQuery("a[href^='http:']").not("[href*='prueba.factoriarte.org']").attr('target','_blank');
});
</script>
<?php
}
add_action('wp_footer', 'add_custom_script');
Hey factoriadearteydesarrollo,
Unfortunately it would require quite some time and customization of the theme to achieve this, so I am sorry to tell you that this is not covered by our support. However if its really important for you to get this done, you can always hire a freelancer to do the job for you :)
Best regards,
Basilis