Hi Kriesi,
Is there a setting that sets to automatically open all external links in a new tab instead of the same one?
This would be really great.
Thanks,
Raphael
Hi eKMUch!
Please refer to my post here – https://kriesi.at/support/topic/open-link-in-new-tab-logopartner-element/#post-651447
Regards,
Yigit
Hi Ygit
Thank you I’ve added the following (as to your previous post) code somewhere within functions.php
function custom_class_link(){
?>
<script>
jQuery(window).load(function(){
jQuery('.your-custom-class a').attr('target','_blank');
});
</script>
<?php
}
add_action('wp_footer', 'custom_class_link');
For example if you click on the first link within http://www.elternlobby.ch/mit-pro-kind-pauschale-koennte-man-ungerechtigkeit-beseitigen/ it will still open in the same tab.
Hi,
The above code will work if you add a custom css class name to the link element as explained in the description and this will help you target specific links.
If you like all the external links to open in a new window please check this link https://css-tricks.com/snippets/jquery/open-external-links-in-new-window/
Best regards,
Vinay