Support » Plugins » Widget Logic Conditional for bbPress

  • Resolved RUBYHAUS


    So I love Widget Logic and have had great success using it.
    Here is how I use it for specific Categories etc…
    is_category( array( '6', '7', '14' ) ) || (is_single( array( '6', '7', '14' ) ) && in_category( array( '6', '7', '14' ) ) )

    My question is though…
    How can I write up a conditional that only shows the widgets for bbPress on bbPress and does NOT let the bbPress widgets appear on the blog?

    I tried this and does not seem to work.
    bb_is_forum( 'forumName' )

    My Research Thus Far
    This Page looks correct:

    There are NO “blog” based widgets.

    This Page is incorrect:

    I’m trying to exclude the Forum Widgets but cannot figure this one out as they are not based on Category or Page id’s.

Viewing 4 replies - 1 through 4 (of 4 total)
  • bb_is_forum( 'myForumNameiCreated' )

    produces a Fatal Error:

    Fatal error: Call to undefined function bb_is_forum() in /nfs/c10/h05/mnt/150010/domains/ : eval()’d code on line 1

    Thanks Kuasha42. I did see that but wasn’t sure what it was as it was MP then I went back after you posted and saw the bb part. Thanks for reposting that link!!!

    Because I named my Forum “forum”… This worked like a champ. I added it to every bbPress widget and now only the bbPress widgets show up on the Forum pages and not on the WordPress Blog pages/categories.

    is_bbpress( 'forum' )

    And this is what all my Blog widgets look like.

    is_category( array( '1' ) ) || (is_single( array( '1' ) ) && in_category( array( '1' ) ) )

    I use arrays so that I can target specific categories and such I want them to be visible on.
    That would look like this:

    is_category( array( '1','8','23' ) ) || (is_single( array( '1','8','23' ) ) && in_category( array( '1','8','23' ) ) )

    There are probably better ways of doing this but this has worked great for me and been more consistent and bullet proof. I also have lots of flexibility doing it this way.

    I suppose if you have more than 1 Forum Name you could do this too:
    is_bbpress( ‘forum’,’coolforum’,’anotherforum’ )

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Widget Logic Conditional for bbPress’ is closed to new replies.