I have a Wordpress site where there is a restricted page, and if the user navigates to this page but is not logged in, they get sent to a sign-up page.
If they log in using this form, they do get logged in but they stay on the same page showing the login form.
I want them to be able to log in and then when the page re-loads, they get sent to whichever restricted page they were previously trying to view.
In my page template I have used:
<?php if(!is_user_logged_in()) { ?>
show login form
<?php } else { ?>
<?php } ?>
And its the blank space where I need to put something to say if they ARE logged in then go back to previous page (before they got redirected for not being logged in).
Thanks