Skip to:
Content
Pages
Categories
Search
Top
Bottom

bbp_after_main_content


  • jon182
    Participant

    @brody182

    I am trying to add a hook after the <div id=”bbpress-forums”>

    when I try this hook it does not work..

    function after_content_hook(){
      echo "my content";
    }
    add_action( 'bbp_after_main_content','after_content_hook');

    is this hook only available for Twenty Twelve theme?
    can we add a hook after the id=”bbpress-forums” ?

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

  • Robin W
    Moderator

    @robin-w

    this <div id=”bbpress-forums”> is used in several places – if you can describe where you want to add, I can probably find the right hook for you.

    Most of the hooks are in the templates, located in

    templates/default/bbpress/

    the main forum uses

    content-archive-forum.php

    which has an action hook of

    ‘bbp_template_after_forums_index’ so if it just the main forum list then

    add_action( 'bbp_template_after_forums_index' ,'after_content_hook');
    #
    would work


    jon182
    Participant

    @brody182

    I want to add a hook after this div (<div id=”bbpress-forums”>) in the index and archive pages.


    Robin W
    Moderator

    @robin-w

    in index, then

    add_action( 'bbp_template_before_forums_index' ,'after_content_hook');


    jon182
    Participant

    @brody182

    I know abut that one, I don’t want to add a hook inside the bbpress-forums div, I want to add a hook outside of the bbpress-forums div.

    <div id=”bbpress-forums”>
    </div>
    <!– my hook here –>


    Robin W
    Moderator

    @robin-w

    which is back to my earlier post

    add_action( 'bbp_template_after_forums_index' ,'after_content_hook');
    

    There is </div> after this, but if you start you code with a close div and open a fresh one, then the one at the start of this sentence will then close yours


    jon182
    Participant

    @brody182

    it still adds the hook inside the bbpress-forums div

    is that supposed to happen?


    Robin W
    Moderator

    @robin-w

    can you post your code please


    jon182
    Participant

    @brody182

    I got it, thanks for the help.


    Robin W
    Moderator

    @robin-w

    no problem !!

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