Leave a Reply

1 comment

  1. Here is a function i use to display the log in/out and registration URLs

    //Add login/logout link to naviagation menu
    function add_login_out_item_to_menu_wpa84418( $items, $args ){
    
        //change theme location with your them location name
        if( is_admin() ||  $args->theme_location != 'LOCATION' )
            return $items; 
    
        $redirect = ( is_home() ) ? false : get_permalink();
    
        if( is_user_logged_in( ) )
            $link = '<a href="' . wp_logout_url( $redirect ) . '" title="' .  __( 'Logout' ) .'">' . __( 'Logout' ) . '</a>';
        else {
            $link = '<a href="' . wp_login_url( $redirect  ) . '" title="' .  __( 'Login' ) .'">' . __( 'Login' ) . '</a>';
            if (get_option('users_can_register'))
                $link = wp_register('<li>', '</li>', false) . $link;
    
        }
        return $items.= '<li id="log-in-out-link" class="menu-item menu-type-link">'. $link . '</li>';
    
    }
    add_filter( 'wp_nav_menu_items', 'add_login_out_item_to_menu_wpa84418', 50, 2 );
    

    Just make sure you change theme LOCATION with your them location name