Skip to:
Content
Pages
Categories
Search
Top
Bottom

What does the single-view template do?


  • Anointed
    Moderator

    @anointed

    I pretty much understand all the templates in bbPress with the exception of single-view.php

    Where is this template called and what is it used for?

Viewing 3 replies - 1 through 3 (of 3 total)

  • TFUME
    Member

    @tfume

    Apologies for bringing this up again but I’m stiffed if I can figure out how the single-view template files are used either.

    Anyone figure this out?


    John James Jacoby
    Keymaster

    @johnjamesjacoby

    Topic views are specific ways to group topics together based on any criteria. bbPress comes with 1 view: Topics with no replies. Developers are free to extend the views in bbPress, much like we have here at bbPress.org with the support plugin.


    TFUME
    Member

    @tfume

    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/

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