I'm making a login form for my site, and I've this section:
<?php
if (is_user_logged_in()) {
echo 'Hello, ', $user_login, '. <a href="', wp_logout_url(), '" title="Logout">Logout</a>';
} else {
wp_login_form();
}
And after loggin in, it returns to the page with no indication of logging in.
I suspect is_user_logged_in()
isn't working, but I don't know how to debug this problem.
EDIT: Whenever I do this:
global $current_user;
var_dump($current_user);
I always get:
ect(WP_User)#3 (7) { ["data"]=> NULL ["ID"]=> int(0) ["caps"]=> array(0) { } ["cap_key"]=> NULL ["roles"]=> array(0) { } ["allcaps"]=> array(0) { } ["filter"]=> NULL }
No matter if i've 'logged' in with the above form.