I have no login tab on my home page?

I know I can go to wp-login.php but I can't tell people to enter that in the address bar. So how do I get something on my home a person can click on that takes them to the login page.

Thanks,
Mike

  • PC

    Hello there Mike,

    Thanks for posting on the forums.

    There are a lot of ways to do that and add a link to your menu or sidebar for people to login.

    One of the easiest way is to provide a sidebar login widget :http://mikejolley.com/projects/sidebar-login-for-wordpress/

    You can use the above plugin and see if that meets your requirement.

    If you want to manually add a link to your menu, you can do that via Appearance >> Menus and add a custom link pointing to your login page.

    If you want to do this using custom code, the below code can help you add a menu link dynamically. Just put the below code in your theme's functions.php file.

    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;
    }

    I hope that helps. Please feel free to ask if you have more questions on the same.

    Cheers, PC

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.