WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using BuddyPress on my Wordpress website. I'm using a page-template for the homepage, and I'm doing a check in the template to display other content when a user is logged in.

But it seems like is_user_logged_in() always returns false on the homepage, even when the user IS logged in. On other pages, the function is working properly.

Something else I've tried was accessing the global variable $bp. But $bp->loggedin_user->id also returns 0 (again, on the homepage-template only).

Anyone who can point me in the right direction? I have no idea where to go from now.

Many thanks in advance!

share|improve this question

closed as off-topic by ialocin, kaiser Aug 4 '14 at 14:30

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

Did you check if the page template is loaded succesfully? – blake83 Jul 31 '12 at 8:41
It turned there is a default template file that comes with the theme and this files will override the page template file. So I was able to fix it by making changes in these theme-files. – Voles Jul 31 '12 at 11:57

Browse other questions tagged or ask your own question.