Skip to:

Discriminate content depending on BBPress or WP

  • Ok, I am trying to serve up content based on whether a user is on the WP side of my site, or on the BB side. Trent, you helped me with this earlier, but you helped me find a much more common sense solution to the problem in that situation.

    Here’s what I’m wondering: Is there any way to say “if bbpress” then do this, or “if wordpress” then do this? I can’t seem to find the code I need to tell wordpress AND bbpress to both understand and accept this discrimination. Thanks


Viewing 5 replies - 1 through 5 (of 5 total)
  • What kind of content are you trying to distinguish between? Theme content or actual content? With wordpress being a blog and bbPress a forum, the content itself would be different. I guess I don’t quite understand exactly what you are trying to do. Could you explain to me like I am 5 years old (my wife says I act that old anyways ;)


    Well, in this case I am calling the header file from wordpress on the bbpress pages. The only problem is that I have things in the bbpress header like




    which create tons of problems when I put that code in the wp header file. I was able to load wp when bbpress loads, but it seems like the opposite would also be useful, to register bbpress when wp loads. I suppose through reverse engineering, I could figure that out on my own?! Otherwise, I would like to just be able to tell the page, “Hey, are you wordpress, then load this…otherwise, don’t load it. And if your BBPress, then load this, otherwise don’t load it”.

    Currently I am also trying to specify which stylesheets to load. If it’s wp, I want the wp stylesheet, and if it’s bb, I want the bb stylesheet, and I don’t want the conflicts when both load.

    1 – Does this make sense?

    B – Is there a solution? and

    4 – Am I overlooking a more obvious solution?



    any ideas?

    I guess I don’t really have any ideas off the top of me head here. I guess it is hard to conceptially figure out why it is important to run the wp header in bbPress. Why not duplicate the wp header information in header.php in your bbPress theme (in bbPress format) and then each one automatically calls the content and stylesheet needed for its own content?

    Even all the errors that you are recieving with the logged in parts would be gone if you used each header independant of each other. The systems knows the user logged in for both sites through the use of cookies and has nothing to do with the actual system calls.

    The only importance would be in you plan on having wp content in bbPress side or vice-versa. But, if the content is only based on each side, the system does this by default.

    Does that make any sense? I am really trying to really understand what you need to do a bit better so the solution will just ‘jump out at us!’



    First of all, thanks for all your help with getting this all straightened out. I’ve gotten a lot done thanks to your help alone.

    As for the 1 header approach, maybe I am creating a “complexity by simplicity” approach, and if what you are saying is correct, then I’m probably better just making the wp side have a wp header, and the bb side have a bb header. I guess I just thought in the long run it would be simpler and more effective to have one-size-fits-all header with the necessary bb code and wp code being selected only when it was needed. That was before now, when I just assumed that since you could call wp code in bbpress, that you could also just as easily call bb code in wordpress.

    So, I will create a second, separate header file for bbpress, and I will see where that takes me in this process. Thanks for your help with this. I hope my reasoning at least makes sense now, even though it is probably faulty reasoning at that.


Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.
Skip to toolbar