Page 1 of 1

Can you set login welcome page to the referring page?

PostPosted: July 13th, 2010, 10:33 am
by mkrank
I am in love with the s2Member plugin - really made my life a lot easier. One thing that I'm stuck on:

On the site I'm building, there's a login/logout button on the top right of each page. When a user logs in, I'd really like to just take them right back to the page they were at when they clicked 'login.' I just haven't the foggiest idea what the replacement code might be for that.

Is this possible?

Re: Can you set login welcome page to the referring page?

PostPosted: July 14th, 2010, 4:34 pm
by Jason Caldwell
Hi there. Thanks for the kudos. Great to hear that.
On the site I'm building, there's a login/logout button on the top right of each page. When a user logs in, I'd really like to just take them right back to the page they were at when they clicked 'login.' I just haven't the foggiest idea what the replacement code might be for that.

Is this possible?

Absolutely. Most WordPress login links and/or forms... are designed to communicate with the /wp-login.php file. The wp-login.php file can also accept a parameter ( redirect_to ).

So you just need to do something like this:
Code: Select all
<a href="http://yoursite.com/wp-login.php?redirect_to=http://yoursite.com/some-specific-page/">Login</a>