Skip to:
Content
Pages
Categories
Search
Top
Bottom

Display forum'description on the front-end

  • @vauvarin

    Participant

    Hello,

    I would like to display on the front-end (over forum list on bbpress root page) the forum’s description (see here: http://i.imgur.com/o3c5iA1.png … to see what i’m speaking about).

    I know there is a hook to put some content in this area “bbp_template_before_forums_index” but is there a function or a shortcode to get the forum’s description (http://i.imgur.com/o3c5iA1.png) ?

    Thx

Viewing 7 replies - 1 through 7 (of 7 total)
  • @robin-w

    Moderator

    The forums list display comes under the template

    wp-content/plugins/bbpress/templates/default/bbpress/loop-single-forum.php

    There are many hooks in this

    Line 44 does the sub forum display

    @vauvarin

    Participant

    I found this solution :

    add_action( 'bbp_template_before_single_forum' , 'xxxx_bbp_display_forum_description' );
    
    function xxxx_bbp_display_forum_description() {
        echo '<div>';
        bbp_forum_content();
        echo '</div>';
    }

    @vauvarin

    Participant

    Maybe better like this :

    add_action( 'bbp_template_before_single_forum' , 'xxxx_bbp_display_forum_description' );
    
    function xxxx_bbp_display_forum_description() {
    
        $display_forum_description = bbp_get_forum_content();
    
        if ( bbp_is_single_forum() && ! empty( $display_forum_description ) ) {
        
            echo '<div class="bbp-display-forum-description">';
            echo $display_forum_description;
            echo '</div>';
    
        }

    }

    @robin-w

    Moderator

    looks good, have you tried it and does it work,

    If so I’ll add it to the codex

    @vauvarin

    Participant

    Yep, works perfectly 🙂

    @robin-w

    Moderator

    Thanks, I’ve slightly amended it to get it to display on all pages and added it to the documentation

    Layout and functionality – Examples you can use

    Thanks again for posting your solution !

    @zeineddine

    Participant

    Gilles, can’t thank you enough. Just what I was looking for. Works beautifully.

    Rob

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