I’m looking for a function that can redirect users when they logout to the current page. I’m looking for a code I can use in functions.php
?
Leave a Reply
You must be logged in to post a comment.
I’m looking for a function that can redirect users when they logout to the current page. I’m looking for a code I can use in functions.php
?
You must be logged in to post a comment.
Using this code in the
functions.php
does the trick:Note – The above code works only on non-admin pages. To make this work on any page you should replace:
With:
Have a look here – http://codex.wordpress.org/Function_Reference/wp_logout_url
Easy as adding this:
It’s really easy:
Now
get_permalink()
is out of the loop.Or change home URL to current page URL.