Skip to:
Content
Pages
Categories
Search
Top
Bottom

Order topics by # of replies (popularity)


  • highexistence
    Participant

    @highexistence

    How can I output the topics loop ordered by # of replies? I know I can grab them via wp_query, but I’m not sure how to also grab voices, latest poster avatar, etc. (to mimic the default topic loop).

    Any ideas? Thank you!

Viewing 1 replies (of 1 total)

  • highexistence
    Participant

    @highexistence

    I was able to do this with the following code:

    <?php if ( bbp_has_topics( array( 'meta_key' => '_bbp_reply_count', 'orderby' => 'meta_value', 'show_stickies' => false ) ) ) : ?></p>
    <?php bbp_get_template_part( 'bbpress/loop', 'topics' ); ?>
    <?php bbp_get_template_part( 'bbpress/pagination', 'topics' ); ?>
    <?php else : ?>
    <?php bbp_get_template_part( 'bbpress/feedback', 'no-topics' ); ?>
    <?php endif; ?>

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.