Skip to:

Re: wp-bb, is it possible to define conditional tags for bbpress?

“What’s the actual problem? How are you using it, what do you expect it to do, what exactly is it doing?”


In my wp-bb integration, bbpress is integrated in wordpress and the forum uses the wordpress sidebar. I want to insert advertising blocks in the free space that I have in the bottom of the sidebar.

I’m trying to use wp conditional tags to display different ad blocks because in some pages I have space enough for one block, and in other pages I have space for two or three blocks.

In wp single pages I can display at least two 120×600 blocks so I’m using is_single() but I realized that these blocks are appearing in the bbpress forum too! and I just have no space enough for them so I want to change them for a 125×125 block when the forum is displayed or perhaps I could remove all ads when bbpress displayed.

So “How are you using it” -> after copy/pasting your function in my theme functions file, I inserted this code in my sidebar;

<?php if (is_bbpress()

|| is_archive()

) { ?>

<!– 125×125 block –>

<?php } ?>

<?php if (is_single()

|| is_page()

) { ?>

<!– 160×600 block –>

<?php } ?>

“what do you expect it to do” -> showing different ads blocks in the sidebar when bbpress displayed

“what exactly is it doing” -> is showing the blocks I set for is_single ()

Skip to toolbar