• Resolved tronix-ex

    (@tronix-ex)


    Hi Support,

    Very useful plugin, is there a way to to get a list of topics with Most Viewed? just like Most Replies(sitename.com/forums/view/most-replies/).

    Looking forward to receiving your response.

    Thanks,
    Yasir

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author jezza101

    (@jezza101)

    There is nothing like that built in.

    It might be possible to filter the query to use the view counts. Or do a separate page with a custom query.

    The count is stored in post meta so WP query should be able to order by this.

    It’s something I could look at adding, perhaps a most viewed list widget.

    Thread Starter tronix-ex

    (@tronix-ex)

    Appreciate your response, I actually figured it out with below code, hope this will help you to make your widget.

    function rk_top_five_view() {
    bbp_register_view( 'top-five', __( 'Most Viewed' ), array( 
        'meta_key' => '_bbp_reply_count',
        'posts_per_page' => '20' ,
        ' max_num_pages' => '1', 
        'orderby' => 'meta_value_num' ),
    false );
    }
    add_action( 'bbp_register_views', 'rk_top_five_view' );

    Just added this shortcode in the page

    [bbp-single-view id="top-five"]

    Cheers!

    • This reply was modified 8 years ago by tronix-ex. Reason: added my code
    Thread Starter tronix-ex

    (@tronix-ex)

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Filter with most views topic’ is closed to new replies.