Login/Logout link

Forums Forums Menus Login/Logout link

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #928
    Anonymous
    Member

    Is there any way of including a Login/Logout link in the menu?

    #6681

    You could do it with the custom code box. But that only allows HTML, so it wouldn’t be able to display something different depending on whether the user was logged in or not.

    It can be done with some custom scripting in your theme in place of the pixopoint_menu() function, but the plugin can’t do it by default. I’d be happy to do a customisation for you as part of our [iurl=https://geek.hellyer.kiwi/premium_support/]Premium Support [/iurl] deal but I can’t afford to spend that much time on it for free sorry.

    #6682
    moutonnoir
    Member

    [code:1r2gf2vt]<?php if (is_user_logged_in()) { ?> <li><a href="profile"><span>Profile</span></a></li>
    <?php } else { ?> <li><a href="sign-up"><span>Register</span></a></li> <?php } ?>[/code:1r2gf2vt]

    This is how I do something similar. It

    [size=1:1r2gf2vt]EDIT by Ryan: Added < code> tags.[/color[/size:1r2gf2vt]

    #6683

    Thanks moutonnoir <img decoding=” title=”Smiley” />

    That should do the trick when used with the menus wrapper tags.

    #6684
    moutonnoir
    Member

    [code:1aenqut5]       
    <h5> <div id="logout">
    <?php if (is_user_logged_in()) { ?>  <a href="<?php echo wp_logout_url( get_bloginfo(‘url’) ); ?>" title="Logout">Logout</a>
                 
    <?php } else { ?> <a href="<?php echo wp_login_url( $redirect ); ?>" title="Login">Login</a>  <?php } ?>
                   
    </div></h5>

    [/code:1aenqut5]

    is my loginlogout button. It is more modular.

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.