Hi,
I know that Enfold menu has the option to make a border around a menu item, just by seleting Menu Style -> Button Style (Bordered).
I would like to have this border around my login/logout menu item, but the problem is, that I created a dynamic login/logout menu item on my own, by using the code below, from the Enfold Support (even though I use eMember to check if the user i logged in … but anyway )…
This works fine. My menu item changes from ‘login’ to ‘logout’ as it should, but because I created my menu item myself, I don’t know how to make it bordered.
Q: Can you help me, make my Login/logout menu item bordered?
BR Lise.
function add_login_logout_link($items, $args)
{
if(is_user_logged_in() && $args->theme_location == 'avia2')
{
$newitems = $items;
$newitems .= '<li><a title="'.__('Logout','avia_framework').'" href="'. wp_logout_url(get_permalink()) .'">'.__('Logout','avia_framework').'</a></li>';
}
else if($args->theme_location == 'avia2')
{
$newitems = $items;
$newitems .= '<li><a title="'.__('Login','avia_framework').'" href="'. wp_login_url(get_permalink()) .'">'.__('Login','avia_framework').'</a></li>';
}else{
$newitems .= $items;
}
return $newitems;
}
add_filter('wp_nav_menu_items', 'add_login_logout_link', 5, 2);
Hey Bjørn!
Your HTML is different so you will need to style it separately. Perhaps something like this.
.header-scrolled .av-main-nav > li:nth-last-child(2) a {
transform: translateY(10%) !important;
}
.av-main-nav > li:nth-last-child(2) a {
border: 2px solid black;
border-radius: 3px;
height: auto !important;
line-height: 20px !important;
padding: 5px 13px !important;
position: relative !important;
transform: translateY(80%);
}
Regards,
Elliott
Great. Works. Thank you.