Redirect after login to current URL
I've my login box on any page of my WordPress and I'm trying to redirect to the same page after a user logs in.
For example:
If I make the login in the URL http://localhost/wordpress/category/sub-category/sold
, redirect to the same URL.
I've this in my functions.php
but, using my $url
doesn't work.
How can make the redirection?
function login_go_home(){
//$url ="http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
wp_redirect(home_url());
exit();
}
Topic wp-login-form functions login Wordpress
Category Web