Skip to:
Content
Pages
Categories
Search
Top
Bottom

Hook or template tag for bbPress only page


  • David Gwyer
    Participant

    @dgwyer

    I have a normal WordPress site with the bbPress Plugin installed.

    Is there a hook or template tag I can use to run code when any type of front end bbPress page is displayed (forum/topic/reply etc.)?

    I want to run some custom code, but only if the current page is a bbPress page. I don’t want code to run on every page on my site when it’s not needed (i.e. for non-bbPress pages).

    Thanks.

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

  • royho
    Participant

    @royho

    You can try ‘bbp_template_before_forums_loop’ and ‘bbp_template_before_topics_loop’ hooks…Those two are fired right before any forum or topic is generated at template level.


    Jared
    Moderator

    @jaredatch

    the function to use for a check is is_bbpress()


    David Gwyer
    Participant

    @dgwyer

    Hi Jared,

    Just what I was looking for thanks.

    David

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