redirect - wordpress redirection loop after login -
i have created custom post taxonomy called portfolio such posts have url this: mydomain.com/portfolio/post-name/. fine far found having problem wordpress login , believe causing it. have login link on every post if user log in there supposed redirected post page instead redirection loop error.
if @ url wordpress trying redirect see mydomain.com//post-name/ means taxonomy name missing url , thats causing redirection error.
how can address problem , have redirection fixed?
thank you.
redirect previous page after login add following code in function.php help.
if ( (isset($_get['action']) && $_get['action'] != 'logout') || (isset($_post['login_location']) && !empty($_post['login_location'])) ) { add_filter('login_redirect', 'my_login_redirect', 10, 3); function my_login_redirect() { $location = $_server['http_referer']; wp_safe_redirect($location); exit(); } }
Comments
Post a Comment