I would like to make the footer links open in a new tab. I have found some information about adding a ‘class’ to the link to make this work. Unfortunately it is not possible to add a class to items in the footer menu. How can I make this work?
Hey StyleCreations,
Can you try adding this PHP code in functions.php:
function footer_links_in_new_tab(){
?>
<script>
(function($) {
$(document).ready(function(){
$('.sub_menu_socket a').attr('target','_blank');
});
})(jQuery);
</script>
<?php
}
add_action('wp_footer', 'footer_links_in_new_tab');
If it does not work, please give us a link to your site.
Best regards,
Nikko
Unfortunately that does not work. I get the error page of WordPress when I add this to the functions.php.
I will share the link etc. via the private content
Hey,
I went to Appearance > Menus and clicked “Screen options” on top right corner and enabled “Link Target” then edited your menu items and simply chose to open them in new tab.
Please review your website :)
Cheers!
Yigit
Thank you! I didn’t knew that option could be found over there… Thank you for the fast support
Hi,
You are welcome! :)
For your information, you can take a look at Enfold documentation here – https://kriesi.at/documentation/enfold/
If you have any other questions or issues, feel free to start a new thread under Enfold sub forum and we will gladly try to help you :)
Enjoy the rest of your day!
Best regards,
Yigit