Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm not very familiar with the bbPress plugin. I would like to list two or three recent topics below the title of the forum (as well as the number of their replies):

enter image description here

This is loop-bbp_forums.php:

<?php

/**
 * Forums Loop
 *
 * @package bbPress
 * @subpackage Theme
 */

?>

<?php if ( bbp_has_forums() ) : ?>

    <table class="bbp-forums">

        <thead>
            <tr>
                <th class="bbp-forum-info"><?php _e( 'Forum', 'bbpress' ); ?></th>
                <th class="bbp-forum-topic-count"><?php _e( 'Topics', 'bbpress' ); ?></th>
                <th class="bbp-forum-topic-replies"><?php _e( 'Replies', 'bbpress' ); ?></th>
                <th class="bbp-forum-freshness"><?php _e( 'Freshness', 'bbpress' ); ?></th>
            </tr>
        </thead>

        <tfoot>
            <tr><td colspan="4">&nbsp;<?php // @todo - Moderation links ?></td></tr>
        </tfoot>

        <tbody>

            <?php while ( bbp_forums() ) : bbp_the_forum(); ?>

                <tr id="bbp-forum-<?php bbp_forum_id(); ?>" <?php bbp_forum_class(); ?>>

                    <td class="bbp-forum-info">
                        <a class="bbp-forum-title" href="<?php bbp_forum_permalink(); ?>" title="<?php bbp_forum_title(); ?>"><?php bbp_forum_title(); ?></a>

                        <?php bbp_list_forums(); ?>

                        <div class="bbp-forum-description"><?php the_content(); ?></div>
                    </td>

                    <td class="bbp-forum-topic-count"><?php bbp_forum_topic_count(); ?></td>

                    <td class="bbp-forum-reply-count"><?php bbp_forum_reply_count(); ?></td>

                    <td class="bbp-forum-freshness">

                        <?php bbp_forum_freshness_link(); ?>

                        <p class="bbp-topic-meta">

                            <?php bbp_author_link( array( 'post_id' => bbp_get_forum_last_active_id(), 'size' => 14 ) ); ?>

                        </p>
                    </td>

                </tr><!-- bbp-forum-<?php bbp_forum_id(); ?> -->

            <?php endwhile; ?>

    </table>

<?php endif; ?>
share|improve this question
    
Last time I checked, the bbPress plugin was in pre-alpha stage, so it's unlikely that you'll get support for it. Also, any answer that you might get could be rendered obsolete very fast. In other words, don't live on the bleeding edge if you can't take it. –  scribu Feb 27 '11 at 13:49
    
@scribu So I should'nt go live with my bbPress based website? (And wait until March?) –  janoChen Feb 28 '11 at 7:24
1  
Everywhere in the bbPress forums it says: "don't use the plugin on production sites yet". –  scribu Feb 28 '11 at 14:02
add comment

3 Answers

up vote 3 down vote accepted

scribu is correct. The code to do this does exist within the plugin, but that code is subject to change as the bbPress plugin continues to be developed.

If you're comfortable snooping through code and finding the functions to make this happen, we're happy to fix any bugs you might find along the way. You may also have more luck asking your question at the bbPress.org support forums, as there are a few people there currently testing the bbPress plugin and keeping up with its daily developments.

share|improve this answer
add comment

This code should be added on loop-topic.php

<ul class="bbp-topics">

<?php while ( bbp_topics() ) : bbp_the_topic(); ?>

<?php if ( bbp_get_topic_forum_id() == bbp_get_forum_id() ) : ?>

<?php bbp_get_template_part( 'loop', 'single-topic' ); ?>

<?php endif; ?>

<?php endwhile; ?>

</ul>
share|improve this answer
    
Why? Please add an explanation to code fragments. –  toscho Oct 10 '12 at 16:47
add comment

Se is it okay to use it now ? I'm having the same issue here. I'm trying to list the sub forums just like what @janoChen is trying to do. so is there any hope on making this happen ?

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.