Page 1 of 1

Login then redirected to previous page

PostPosted: August 2nd, 2011, 7:45 am
by hazardous_waster
Hello Peeps

You've helped me no end a few times before so thank you all for that but I've got another question, here's hoping you can help me again.

Here's my little project if you want to take a look ... http://intelligent-investment.notknowndesigns.co.uk/

Should be a fairly simple request but I can't find any one talking about it or any information on the forums so here I am, Once you login to the site my client wants to redirect the user to the page they where just on, so for example if I click on the 'about' page, then click the login button near the bottom of the page, I want to be taken to the login page, fill in my details (try username - test, password - test if you wanna give it a go) his the enter button and then be taken back to the 'about' page and NOT the 'welcome cheers for loging in' page.

Any ideas?

Cheers in advance, Neil.

Re: Login then redirected to previous page

PostPosted: August 2nd, 2011, 11:17 pm
by Cristián Lávaque
Hi Neil.

You can use the s2Member Pro Login Widget if you have it, it's got a setting that will let you take the person back to the page he's logging in from.

Re: Login then redirected to previous page

PostPosted: August 18th, 2011, 12:51 pm
by hazardous_waster
I've just got the pro version so that I can do this ... can't find the option, how do I do this?

N

Re: Login then redirected to previous page

PostPosted: August 18th, 2011, 3:13 pm
by Cristián Lávaque
WP Admin -> Appearance -> Widgets -> s2Member Pro Login Widget -> Redirection After Login -> Previous Page

:)

Re: Login then redirected to previous page

PostPosted: August 18th, 2011, 5:41 pm
by hazardous_waster
I dont think this is what I'm after ... let me show you what I have so far ...

http://www.intelligent-investment.co.uk

so what Im after is say you go to the 'about' page, then hit login from any of the links on that page in the header or in the footer, then your taken to the login page, once you login then your redirrected back to the about page .. this seems to add a login widget to the about page, not what I am after at all, does that make sense, is it possible?

N

Re: Login then redirected to previous page

PostPosted: August 19th, 2011, 1:17 am
by Cristián Lávaque
I see. Well, the widget is a widget.

You could edit the login links in the theme's templates. This may help: https://codex.wordpress.org/Function_Re ... _login_url

Code: Select all
<a href="<?php echo wp_login_url(get_permalink()); ?>">Login</a>