Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1164451
    krissy28
    Participant

    hi!
    i have added this to site

    add_filter('wp_nav_menu_items', 'add_login_logout_link', 10, 2); function add_login_logout_link($items, $args) { ob_start(); wp_loginout('index.php'); $loginoutlink = ob_get_contents(); ob_end_clean(); $items .= '<li>'. $loginoutlink .'</li>'; return $items; }

    but it seems like it is not aligned with the menu and it is floating

    pls assist thanks!

    #1164453
    krissy28
    Participant
    This reply has been marked as private.
    #1164578
    Thai
    Moderator

    Please provide us with your admin account so we can take a closer look.

    Thanks.

    #1164592
    krissy28
    Participant
    This reply has been marked as private.
    #1164621
    krissy28
    Participant

    as you can see the login/logout and cart menu items are floating and not aligned..

    #1164691
    krissy28
    Participant
    This reply has been marked as private.
    #1164714
    Thai
    Moderator

    Hi There,

    Please update your code to this:

    add_filter('wp_nav_menu_items', 'add_login_logout_link', 10, 2); 
    function add_login_logout_link($items, $args) { 
    	ob_start(); 
    	wp_loginout('index.php'); 
    	$loginoutlink = ob_get_contents(); 
    	ob_end_clean();
    
    	$items .= '<li class="ubermenu-item login-logout-link">'. $loginoutlink .'</li>'; 
    
    	return $items; 
    }

    After that add the following CSS under Customizer > Custom > Global CSS:

    .login-logout-link a {
        font-weight: bold;
        display: block;
        text-decoration: none;
        position: relative;
        padding: 15px 20px;
        color: #888888;
    }

    Hope it helps 🙂

  • <script> jQuery(function($){ $("#no-reply-1164451 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>