Skip to:
Content
Pages
Categories
Search
Top
Bottom

Determining if on bbpress page


  • phrough
    Member

    @phrough

    Is there a function (or other method) available to determine if the current page is a bbpress related page (forum, topic, reply or other)? Something along the lines of the wordpress function is_page()

    It would seem that bbPress uses custom post types, and I’ve tried this with no luck:

    if(get_post_type() == ‘forum’ OR get_post_type() == ‘topic’ OR get_post_type() == ‘reply’)

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)

  • phrough
    Member

    @phrough

    Turns out I had a nesting issue, the above approach seems to work fine:

    if(get_post_type() == ‘forum’ OR get_post_type() == ‘topic’ OR get_post_type() == ‘reply’) {

    //user is viewing a forum page

    }


    kennymcnett
    Member

    @kennymcnett

    thanks phrough!!

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