Hello,
I'm trying to redirect after login (and logout) but with no success :( It just goes to the backend.
Here's my code:
<?php
if (is_user_logged_in()) {
echo '<a href="' . wp_login_url( get_permalink(5) ) . '">Logout<span></span></a>';
} else {
echo '<a href="' . wp_logout_url( get_permalink('home') ) . '">Login<span></span></a>';
} ?>
All help is very much appreciated, thaks :)
Maybe this will work....
<?php
echo '<a href="'.wp_logout_url(get_bloginfo('url')).">Logout<span></span></a>';
Thanks, but no :(
It just redirects me straight back to the home page, not even showing the login form. No matter is it: get_permalink(5) or bloginfo('url')
The link it outputs is: http://example.dev:8888/example/wp-login.php?action=logout&redirect_to=http%3A%2F%2Fexample.dev%3A8888%2F&_wpnonce=a0a724313f
Works! Sorry for the last one :)
And thanks!!!!!