WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

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 different headers for in my wordpress/buddypress setup and I need a conditional statement for member pages. So everything that comes after mysite.com/members/. How do I do that with something like is_page()?

share|improve this question
up vote 1 down vote accepted

Try this function bp_is_members_component().

share|improve this answer
I tried using it like if (bp_is_members_component()){ but that didn't work. – Pollux Khafra Mar 10 '12 at 15:03
Where did you use that conditional check? Tested bp_is_members_component() and returns true on members directory page. – Mamaduka Mar 10 '12 at 15:39
I used it in my header.php. <?php if (is_single()){ include(STYLESHEETPATH.'/header-post.php');} elseif (bp_is_members_component()){ include(STYLESHEETPATH.'/header-post.php');} else { include(STYLESHEETPATH.'/header-default.php');} ?> – Pollux Khafra Mar 10 '12 at 15:53
It still returned the default header. – Pollux Khafra Mar 10 '12 at 15:54
Tested in header.php and works fine. – Mamaduka Mar 10 '12 at 16:18

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.