I'm trying to assign a special template only to buddypress pages (activity, members, profile...). All other posts / pages use a different template. Problem is: I just can't find a good way to tell if a page is "rendered" by buddypress or by the wp "core". I've looked in the bp codex and found the template tag bp_is_member() and others, but none for an overall approach. Are there hooks that I could use or other template tags that I didn't find?

I'm not looking for a customization of the sidebar only, so conditional widget plugins won't do the job.

Any help is appreciated Heiner


bp_current_component() does not necessarily return a boolean - it returns false if not in a BP component, but will return the name of the component otherwise, as a string.

Internally, BP uses the function bp_is_blog_page() to do what you're asking - if it returns true, it's not a BP page.


Ok, I've found the solution to my problem. Buddypress offers a simple function that returns a boolean value:


Now all I have to do is call that function and include it in an if else statement.

Thanks to ZaMoose who has found this easy solution http://xrl.us/bmxm8e

Hope this helps some else also.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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