WordPress.org

Support

Support » How-To and Troubleshooting » Add login/register to nav menu? Help please

Add login/register to nav menu? Help please

Viewing 2 replies - 1 through 2 (of 2 total)
  • Please some one can help me? I make a new modification for redirect to the same page:

    function add_login_logout_link($items, $args) {
    
            ob_start();
            wp_loginout( $_SERVER['REQUEST_URI'] );
            $loginoutlink = ob_get_contents();
            ob_end_clean();
    
            $items .= '<li>'. $loginoutlink .'</li>';
    
        return $items;
    }
    add_filter('wp_nav_menu_items', 'add_register_link', 10, 2);
    function add_register_link($items, $args) {
    
            ob_start();
            wp_register('');
            $registerlink = ob_get_contents();
            ob_end_clean();
    
            $items .= '<li>'. $registerlink .'</li>';
    
        return $items;
    }

    I think the experts at WordPress.stackexchange.com can help you with this. Ask it there and please let me know the link of question after you post

    Thanks !

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Add login/register to nav menu? Help please’ is closed to new replies.
Skip to toolbar