Login-logout

Login-logoutdonateview source

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:

WordPress Login-Logout plugin

  • 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:

WordPress Login-Logout plugin

  • 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('', ''); ?>

93 comments on “Login-logout

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

    • webvitaly Post author

      Try to add these css styles:

      .wrap_login_logout li { list-style-type: none; }

  2. Pingback: Antivirus Software Blog » Login Logout 2.6

    • webvitaly Post author

      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.

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

    • webster Post author

      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".

      • 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

        • webster Post author

          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.

  4. 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.

  5. 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.

    • 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?

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

    • webster Post author

      You may insert your code into the login-logout.php into line #112.
      Also change the version of the plugin to "100" for avoiding plugin updates and losing your code.

  7. 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!

    • webster Post author

      There is no shortcode to do that.
      But you can use this code:
      < ?php wp_loginout( get_permalink() ); ?>
      < ?php wp_register('', ''); ?>

  8. charlie

    Hey there,
    I'm using buddypress and wanted to know how would I redirect users their members profile after they login?
    Here is an example link to get to the screen I want.
    http://www.mysite.com/members/jane-doe/

    But how would I set it up for any user who login go to their profile page?

    • webster Post author

      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.

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

    • webster Post author

      You should change plugin version to "100" in 6-th line in login-logout.php file.
      What link do you set (when it is not working) as link for redirect?

      • 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

        • webster Post author

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

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

  11. 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

    • webster Post author

      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.

      • 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

          • 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?

            • webster Post author

              Yes, keep the code and just change the admin_url() section. Good luck ;)

              • charlie

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

  12. Thanks bro for fast reply. Very2 appreciate it.

    One more question, How to make it display in center and bold?

    • webster Post author

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

Submit comment

Allowed HTML tags: <a href="http://google.com">google</a> <strong>bold</strong> <em>emphasized</em> <code>code</code> <blockquote>
quote
</blockquote>