Redirect(s)
-
Hello, I used your plugin mainly because it automatically redirects users to home page when they log from the login area.
Problem is I had another requirement and I added the following lines to single.php:
if(!is_user_logged_in()){
wp_safe_redirect(wp_login_url(get_post_permalink()));
exit();}else{get_header();}If I deactivete your plugin, this perfectly works and the user is redirected to the standard login page and, afterwards, to the “private” content he was trying to access.
If your plugin is active, after user logs, he goes directly to the home page.
Is there any way to have both functionalities? What I need is basicly this:
I want to restrict the access of some areas of my WordPress blog only to logged in users. In particular, I want to restrict ALL the posts and SOME pages: when a non-logged-in user tries to access the protected content, he should be redirected to the standard login page and, once logged in, he should be redirected to the content he was previously tried to access.
The topic ‘Redirect(s)’ is closed to new replies.