Skip to:
Content
Pages
Categories
Search
Top
Bottom

Sort topics alphabetically


  • sha77ered
    Participant

    @sha77ered

    Hi there,

    Ive been searching all over for a solution to this problem and have tried extensively myself to solve it, but to no avail. Please if someone could offer some guidance i would really appreciate it.

    So on the forum root if one display the topics directly, I would need the option allow the user to sort the topics alphabetically or by date. Perhaps this should be considered a default feature in bbpress?

    Anyways, I realise that the ‘bbp_has_topics’ function in includes>topics>template.php needs to be hooked into and changed, but how to do that I dont know.

    Any support would be greatly appreciated.

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

  • Robkk
    Moderator

    @robkk

    you can use the bbpress views, and put the views widget in your sidebar

    see if this works , put this function into your functions.php

    function rkk_register_custom_views() {
    bbp_register_view( 'desc', __( 'Z-A' ), array('orderby'=> 'title', 'order' => 'DESC'), false );
    bbp_register_view( 'asc', __( 'A-Z' ), array('orderby'=> 'title', 'order' => 'ASC'), false );
    bbp_register_view( 'date-asc', __( 'Date ASC' ), array('orderby'=> 'date', 'order' => 'ASC'), false );
    bbp_register_view( 'date-desc', __( 'Date DESC' ), array('orderby'=> 'date', 'order' => 'DESC'), false );
    }
    add_action( 'bbp_register_views', 'rkk_register_custom_views' );

    sittle
    Participant

    @sittle

    Hey Robkk How can we display in a page


    Robkk
    Moderator

    @robkk

    @sittle

    Use the view shortcode to display it in a page.

    [bbp-single-view id="desc"]

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