WordPress.org

Forums

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

  1. M3
    Member
    Posted 2 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.

    http://wordpress.org/extend/plugins/baw-login-logout-menu/

  2. Julio Potier
    Member
    Plugin Author

    Posted 2 years ago #

    Hi

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

    So
    [loginout redirect="/page.php"]

    Is it what you want ?

  3. M3
    Member
    Posted 2 years ago #

    Hi,

    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
    Member
    Plugin Author

    Posted 2 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

  • BAW Login/Logout menu
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic