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. Pingback: UaMV on “[Plugin: Lara, Google Analytics Dashboard Widget] Exclude Analytics Code for Logged-In Users” – من خوشحالم

  2. Rob

    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
  3. Dav

    nice plugin. But please how can i change the login and logout and username link address to another page already created.

    Reply
  4. Sven

    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
      1. Sven

        Wow, that was fast! I did not expect such a fast change.

        I upgraded today and found it working.

        Thank you very much!

        Reply
  5. Jon

    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
  6. Kyle

    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
  7. Pingback: Antivirus Software Blog » Login Logout 2.6

  8. Nancy

    When a new customer/user logs in they are directed to the account page rather than the home page even though we have inserted this code http://lzr7store.com/wp-login.php?redirect_to=http://www.lzr7store.com
    as a redirect. Instead it directs to: https://lzr7store.com/my-account/
    I can't even figure out how this happens. HELP. I need to send all my clients users their logins and don't what them going to an account page rather than the home/product page.
    Thanks!

    Reply
    1. webvitaly

      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
  9. Farhaan

    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
    1. webster

      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
      1. Sahar

        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
        1. webster

          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
  10. Aoife

    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
    1. webster

      You may update your version of the plugin for your needs. Edit login-logout.php file. Also change version of the plugin to "100" for avoiding plugin updates and preventing losing your code.

      Reply
      1. Aoife

        Thanks so much for getting back to me so quickly. I'm sorry but I don't know where in the code I need to change to link, can you tell me where?
        Thanks again!

        Reply
  11. charlie

    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
    1. charlie

      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
  12. charlie

    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
  13. Nicco

    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
    1. webster

      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
  14. charlie

    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
      1. charlie

        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
        1. webster

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

          Reply
  15. charlie

    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
  16. charlie

    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
    1. webster

      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
      1. charlie

        Thank you so much for the prompt response. Ok, Im really new to all this.
        $username_link = ''.$username.''; Would i change it to buddypress profile php?

        I want it to go to mysite/members/'.$username' I think

        Reply
          1. charlie

            I lost all content when I use that. Do i keep the code and just change admin_url part or change everything in the link section?

            Reply
              1. charlie

                Thanks I will figure it out, Thanks for your time. really appreciate. Hopefully I wont need to more :-)

                Reply
    1. webster

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

      Reply

Leave a Reply to webster Cancel reply

Your email address will not be published. Required fields are marked *