Login-logout

Speedup WordPressLogin-logoutDonateGitHub

WordPress plugin: widget with login or logout link. It is the replacement of the default Meta widget.

"Login Logout" plugin add widget with login or logout link.

If user is not logged in there are two links:

  • login (after login action user will return to previous page);
  • register (if user can register) (if checkbox is active);

If user is logged in there are two links:

  • logout (after logout action user will return to previous page);
  • site admin (if checkbox is active);

Translation

  • Spanish translation made by Maria Ramos from WebHostingHub
  • Serbian translation made by Borisa Djuraskovic from WebHostingHub

If you need "login-logout" link you can use this code without the plugin:

<?php wp_loginout( get_permalink() ); ?>

If you need "register-admin" link you can use this code without the plugin:

<?php wp_register('', ''); ?>

121 thoughts on “Login-logout”

  1. When a new user clicks on register it opens into a screen asking for user name and email address but no option for adding a password. How can i make it ask a new user to add a password to their account?

    Reply
  2. Can you please fix the initalization of $redirect_to_self so that the plugin can be used for a wordpress site that is only accessible via https. Currently there is 'http://' hard coded.

    You could use the variable $_SERVER['HTTPS'] which is set to 'on' if https is used for access.

    Thanks in advance.

    Sven.

    Reply
  3. Hi there,
    Using your plugin on my site and it works great - thank you! As a suggestion, I have changed line 69 in login-logout.php from

    $username_link = ''.$username.'';

    to

    $username_link = apply_filters( 'login_logout_username_link', ''.$username.'', $current_user );

    Would you consider including that in the next version? I am using the filter to change the username link to display first name instead of login and to change the link to a different front end user profile page. Obviously I'd love it if you included the filter so I don't have to amend the file again when you update...

    Thanks
    Jon

    Reply
  4. Unsophisticated coder here. What would I need to alter to remove the bullets before each link? I like the inline appearance without it, but would like to retain a vertical presence. Thanks in advance!

    Reply
    • This redirect could be made by some other plugin.
      Check out all your plugin and try to find the plugin which could be responsible for this redirect.

      Reply
  5. hi plz help me...tomorow is my presentation on a web site in wordpress but i dnt knw how can i create login and logout feature for user and also how user registerd on my blog

    Reply
    • Activate Login-logout plugin and add Login-logout widget to sidebar. You may check out how it looks on screenshot page.
      You can enable registration here: "site.com/wp-admin/options-general.php" option called "Anyone can register".
      Login page you can find here: "site.com/wp-login.php".

      Reply
      • what do ou mean by :
        You can enable registration here: "site.com/wp-admin/options-general.php" option called "Anyone can register".
        Login page you can find here: "site.com/wp-login.php".
        plz explain

        Reply
        • You should visit this link "site.com/wp-admin/options-general.php" and enable option "Anyone can register". "site.com" you should change with your own site.

          Reply
  6. Hi I'm just wondering is there a way to have the login link directed to a front end login page that I have instead of the backend wp-login.php? Thanks.

    Reply
  7. Hey there,

    Could you update the plugin, I recently install 3.4.2 and now the plugin isnt working correctly. on my phone, its not reading the login at all and not redirecting me to the page i selected. When i log out, its not letting me log out.

    Reply
    • Hey there,

      I think i put the wrong code in and thats why its not working on my smartphone.

      $username_link = '<a href="'.home_url('index.php').'" rel="nofollow">'.$username.'</a>';
      $welcome_text_new =

      I remember that i told you i didnt want it to link back to the admin bar and this was the code i needed to change. on my phone, when i login, its not redirected me to the page I want it to. do i change index.php to profile?

      Reply
  8. Hey there,

    How would I add facebook twitter, g+ into the login widget? Would i copy the html code from another plugin Im using and add it to the code? if so, where would I add it?

    Reply
  9. Hi!

    Is there a way to make the Login-logout appear in the header? Maybe perhaps a php shortcode for it to appear?

    Would appreciate your help.

    Thanks!

    Reply
    • Sorry, but this is not possible to do with Login-Logout plugin now.
      If you want, you may extend it and I will include this into next versions of plugin.

      Reply
  10. Hey there,

    I finally putting the main site up and I ran into the problem you forewarn me about in may, Since the updates, I have lost redirecting aspect. What line do i use to increase plugin version to 100? and why when I use the widget redirect link after user login, its not working and takes me to the dashboard?

    Reply
      • so where it say 2.3 I put 100?

        Im putting the redirect in the widget area (redirect to this page after login) It worked before but now Its not working at all

        Reply
        • "so where it say 2.3 I put 100?" - yes
          Please, write here the full link, which are you using for redirect.

          Reply
  11. Fyi, I still have to do some work on where I want to direct it but I changed the admin_url to home_url which is working at the moment. Thanks again!!!

    Reply
  12. Hey there,
    Great plugin, How would I redirect the username link (welcome mike)to the site profile instead of the wp dashborad? Dont want users to have access of the dashboard period.

    Thanks

    Reply
    • There is no such possibility now. You may change it manually. Check file login-logout.php line-72. Also increase plugin version to 100 for example for avoiding plugin updates and your code losing.

      Reply
    • try to add this css styles into your style.css file:
      .wrap_login_logout {text-align:center; font-weight:bold;}

      Reply

Leave a Comment