Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: What does the single-view template do?

@tfume

Member

Ah topic views, that points me in the right direction thanks. For reference then if anyone needs it that means you can do stuff like this:

add_action('bbp_register_views', 'view_popular_topics');
function view_popular_topics() {
bbp_register_view('popular-topics', __('Popular Topics'), array('meta_key' => '_bbp_reply_count', 'orderby' => 'meta_value_num'), false );
}

Then link to the view with:

<a href="<?php bbp_view_url('popular-topics'); ?>"><?php bbp_view_title('popular-topics'); ?></a>

There’s a couple of informative posts re this here:

http://internet-alacarte.com/adding-custom-fields-to-bbpress-topics-then-filtering-topics-by-custom-fields-using-views/

http://bbpep.com/blog/2011/04/01/creating-custom-views-in-bbpress/

Skip to toolbar