Skip to:
Content
Pages
Categories
Search
Top
Bottom

Custom bbPress loop to display the recent 5 posts of a forum (bbPress 1.1)?

  • I would like to know how to start a custom bbPress loop to display the recent 5 posts of a certain forum (say Forum Test 1).

    In WordPress I create custom loops like this:

    `<?php $custom_posts = new WP_Query(); ?>

    <?php $custom_posts->query(‘post_type=bbp_topic&posts_per_page=5’); ?>

    <?php while ($custom_posts->have_posts()) : $custom_posts->the_post(); ?>

    <div class=”block-2 border-top”>

    <h2><a href=”<?php the_permalink(); ?>” title=”<?php printf( esc_attr__( ‘Permalink to %s’, ‘twentyten’ ), the_title_attribute( ‘echo=0’ ) ); ?>” rel=”bookmark”><?php the_title(); ?></a></h2>

    <?php the_excerpt(); ?>

    <p><?php comments_number(‘0 Replies’,’1 Reply’,’% Replies’); ?>.</p>

    </div>

    <?php endwhile; ?>`

    How to do what I mentioned above in bbPress 1.1?

Viewing 1 replies (of 1 total)

  • fuzzybee
    Participant

    @fuzzybee

    Someone mentioned using loop the bbPress’ way bbp_has_forums()

    Would you like to give it a try?

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