Getting bbPress and WordPress to talk to each other
I’m not sure if I should ask this here or over at WordPress.org, but perhaps this is more of a bbPress question in the end.
I have the latest bbPress and WordPress installations, and both are running fine. The user databases are integrated, and I have also managed to get bbPress to use my WordPress theme after some poking around.
What I actually did with the theme integration was that I made bbPress to call the WordPress header and footer files instead of the bbPress ones, having in turn modified the WordPress files in a way that everything except for the page-specific content is in those two files. This way, the forum shows up where the WordPress content (posts, pages, etc.) would otherwise go. Life is good.
My problem now is that I would like WordPress to recognize bbPress when it is serving a bbPress page. In other words, I would like to have something like an “if” condition for example in my WordPress header that checks whether the page currently being shown is a bbPress page. If I could do that, then I could do something like “if bbPress then echo bbPress headers, else echo WordPress headers”.
The most basic solution that I could come up with was the following: before having a bbPress page call the WordPress header, introduce a variable like “$forumpage” and set it to “true”. Then simply include a check in the WordPress header that checks whether $forumpage is “true”. For some reason, however, this doesn’t work as the variable seems to get erased.
I also tried something like using the condition if($forums) in the WordPress header, which I saw was in bbPress, but that gave no results, either.
There probably is a(n easy) solution to all this, so I would really appreciate it if someone could point me to the right direction. I’ve spent most of the evening working on this, and have tried just about everything that I can think of and have read about on these forums and over at WordPress.org, but alas without the desired results.
Thanks for reading!
- You must be logged in to reply to this topic.