login / log out button

  • bsacue

    #7665

    Is it possible to add a Login and Logout tab to your main menu nav bar like Home/About us/ etc ? if so direct me to how this has been done please i can’t find anything or even if its possible

    thank you

    Mod

    Kenneth John Odle

    #38923

    Use a custom menu and add a custom link to http://www.example.com/wp-login.php.

    bsacue

    #38924

    I tried that but the menu button i created (login) says login always..i want it to say login when you need to and logout when you are logged in like the meta widget?

    this is what i ment is this possible please ?

    Prasanna SP

    #38925

    Using Action Hooks and PHP widget perhaps?

    <?php
    if ( is_user_logged_in() ) {
    echo '<a href="'.wp_logout_url( get_permalink() ).'" title="Logout">Logout</a>';
    } else {
    echo '<a href="'.wp_login_url( get_permalink() ).'" title="Login">Login</a>';
    }
    ?>

    bsacue

    #38926

    Hi,

    Your code worked fine i just didn’t like the look of it so ill forget this idea, thanks again your a massive help Prasanna SP

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.