Tagged: burger, functions.php, login, logout, menu
Hey Kriesi-Team,
there is a problem with the new Enfold Update to 4.2 an that Code (which puts login and logout links to the menu).
I put this code snippet in my functions.php (childtheme):
// broken code.
With this code in the functions.php, the burger menu ist not clickable anymore. Bevor 4.2 it worked fine.
Thanks for your help!
Timo
Hey Timo,
Thank you for using Enfold.
I checked the site and the link is clickable. Is this fixed?
Best regards,
Ismael
Hi Ismael,
I undid the update to 4.2 cause of the problem. It’s still 4.1.2.
Thank you
Timo
Hi,
I see. Please update to version 4.2 so that we can inspect the issue. Or create a staging/dev site.
Best regards,
Ismael
Hi Ismael, you can find all information in private content. It’s now 4.2. Thanks for your help!
Timo
Hi Timo,
Can you give us temporary admin access to your website in the private content box below, so that we can have a closer look?
Best regards,
Victoria
Hi Victoria,
yes of course.
Hi,
Thank you for the info.
You need to add a class attribute to the menu item. Replace the filter with the following code.
add_filter('wp_nav_menu_items', 'add_login_logout_link', 10, 2);
function add_login_logout_link($items, $args) {
if( $args->theme_location == 'avia' ) {
ob_start();
wp_loginout('index.php');
$loginoutlink = ob_get_contents();
ob_end_clean();
$items .= '<li class="menu-item">'. $loginoutlink .'</li>';
}
return $items;
}
Best regards,
Ismael
Yes, perfect! Thank you so much guys!
Hi Timo,
Glad we got it working for you! :)
If you need further assistance please let us know.
Best regards,
Victoria