Hey there, is there a way to set all links as tagert=”_blank” Links. That is to say links open in new window as a standard
and i can manually change this setting? At the moment its the other way around.
Thank you very much!
All the best and it depends where u come from: Happy Halloween ;-)
tob
Hey Tobiy,
Please try adding this at the very end of your themes / child themes functions.php file:
// open in new window
function newWindow(){
?>
<script>
jQuery(document).ready(function() {
jQuery('#main a').each(function () {
jQuery(this).attr('target','_blank');
});
});
</script>
<?php
}
add_action('wp_footer', 'newWindow');
If you like to target specific links on the page. Please add a class name to the link and use the class name in the above provided code.
Example : jQuery('#main a.custom_link').each(function () {
Best regards,
Vinay
Vinay, you have no idea how much time you saved me with this code. Thank you so much. Thank you :-)
Hi,
Glad we could help! We really appreciate it if you rate our theme on themeforest https://themeforest.net/downloads
To know more about enfold features please check – http://kriesi.at/documentation/enfold/
Thank you for using Enfold :)
Best regards,
Vinay