The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

Login Logout Menu
[resolved] [Plugin: BAW Login/Logout menu] Sidebar Widget Login/Logout and Redirect (4 posts)

  1. M3
    Posted 4 years ago #

    Hi, how can I add the [loginout] to my HTML sidebar widget? I know I can put it directly, but I don't know how to make it to redirect to my login page.

    I manage to do it in the header theme but how I can make it in the HTML sidebar widget?

    Thank you.


  2. Julio Potier
    Plugin Author

    Posted 4 years ago #


    FAQ :
    "The 4 shortcodes are "[login]", "[logout]", "[loginout]" and "[register]". You can set 2 parameters, named "redirect"

    [loginout redirect="/page.php"]

    Is it what you want ?

  3. M3
    Posted 4 years ago #


    Sorry to trouble you again, I have a custom login page to login and logout into my site, so I try using the [loginout redirect="http://..."] which you advise me.

    After I try the code, the login didn't work, because it didn't redirect me to my custom login page and instead to the standard wordpress login page. But after I signed in, the logout code works and it redirect me to my custom login page.

    Simply to say, I want people to login to my custom login page, and when logout, they will also be redirected to the same custom login page.

    At the present, this is the code I'm using in my HTML sidewidget:

    [loginout redirect="http://berita-it-terkini.merdekait.com/?page_id=851"]
    | <a href="http://berita-it-terkini.merdekait.com/?page_id=853" >Join</a>

    Apologize for my poor English :)

    Thank you for your help.

  4. Julio Potier
    Plugin Author

    Posted 4 years ago #

    You are confusing the redirect and the login url.
    So, you need to hook the wp_login_url() function like this :

    function baw_login_url( $login_url, $redirect )
    	return 'http://berita-it-terkini.merdekait.com/?page_id=851&redirect_to=' . urlencode( $redirect );
    add_filter( 'login_url', 'baw_login_url', 10, 2 );

    Ok ?

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Login Logout Menu
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic