August 21, 2015 at 4:59 am
#14905
Syam Mohan
Keymaster
Hi Bratt,
The reason you are getting that error is, that code specifies the home page(‘/’) as the default redirect location if no login redirects found for that user. But your home page also uses this template. So it goes into a redirect loop. You will have the same error, if the URL configured within the login redirect uses the same template/code.
To fix the error, change the default location to a URL which do not use this template/code. For example, change it to ‘/abc/’ and make sure page ABC do not use this template/code.
So your code will change like this.
wp_redirect(apply_filters('login_redirect', '/abc/'));
Let me know if it doesn’t work.
Thanks
Syam