dimanche 1 février 2015

is_user_logged_in() not working after domain change


I am relatively new to Wordpress and I recently moved a WordPress website from one domain to another. I went through and fixed all the links and references that I could find. Now my website has all of its previous functionality, even the databases are working. The only issue that is for some reason the is_user_logged_in() function always returns false. I had this code to restrict users from viewing a page unless they were logged in:



if ( is_user_logged_in() ) {
// logged in code
} else {
// logged out redirect
}


It always goes to the else statement regardless. Oddly, I can see that I am logged in since the log out button appears and when I am logged in as admin the top panel is visible. There are lots of other threads about this online but none of their methods seems to work. I have read and tried methods suggested in these posts:


http://ift.tt/1D2RFzQ http://ift.tt/1BMAVZa http://ift.tt/1D2RFQ4


Is there some other reference I need to fix? How can I do it? Any help is greatly appreciated.





Aucun commentaire:

Enregistrer un commentaire