Skip to:

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

Actually the function works just fine, you’re just expecting it to work differently. Try using different flow control or rewriting your logic.

if( blah_is_true() ) {

} elseif( foo_is_true() ) {

} elseif( third_thing_is_true() ) {

} else {
// default

The elseifs mean that if a previous if statement was true, none of the successive ones will be tried. That way, if it is bb, it won’t even check if it’s single or a page.


if( ( is_single() || is_page() ) && !is_bbpress() ) {


will work just fine.

If you’ve integrated bb into wp that way, of course some of the WP template tags will work that way. If you wanted everything else to return false when you loaded bb, you’d have to do this:

function adjust_flags_to_bb() {
global $wp_query;
add_action('bb_init', 'adjust_flags_to_bb', 999);
//not sure if that's the right action, but meh

but that’s really quite unnecessary.

Skip to toolbar