Login / Logout

  • In Progress
    Posted in: Highend WP Theme  
  • Customer
    mtamilselvan
    February 3, 2015 at 5:34 pm #26033

    Hi,

    i have added a auto login and logout code, but it is not aligned properly in the menu bar. Can you help me to fix this?

    This is the code I have used.

    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 .= ‘

  • ‘. $loginoutlink .’
  • ‘;
    return $items;
    }

Sorry, this forum is for verified users only. Please Login or Register to continue