Support » Plugin: GD bbPress Tools » Change sort order of latest-topics view?

  • Resolved quan_flo

    (@quan_flo)


    Hi,

    first thank you for your plugin, it works fine!

    I migrated a community from another CMS and another forum software to wordpress and bbress and we are missing one thing.
    The last software had a topic view that listet all recent topics almost as your latest-topics view does except the applied sort order.

    Your sort order is the date of the creation of the topic.
    The sort order we had (and my users loved to use this view) was the date of the topic’s last reply.

    Is there an easy way to change this or maybe a possibility to include such a view into the plugin?

    Thanks for your help

    Florian

    http://wordpress.org/plugins/gd-bbpress-tools/

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Milan Petrovic

    (@gdragon)

    Hi,

    There is no plan to add something like that in this plugin. But, Pro version of this plugin is called GD bbPress Toolbox (http://www.gdbbpbox.com/) and it has much more settings for views, and in next 1.7 version will include sorting options too.

    Milan

    Plugin Author Milan Petrovic

    (@gdragon)

    I did a bit of checking on this. My GD bbPress Toolbox Pro plugin has 8 custom views, including latest-topics. This view is sorting topics by the last activity and that basically means sorted by latest reply. Plugin has views sorting topics by reply and only shows topics active in the past 1, 7 or 30 days also.

    Milan

    Is there a way to sort the forum topics where the oldest topic shows first and the newest topic appears last with having to upgrade to the Pro version? Thanks.

    @ritajoc – This plugin does exactly what you need
    http://wordpress.org/plugins/bbpress-sort-topic-replies/

    @sandyrig Thank you very much! I’ll check it out.

    @sandyrig, this plugin is great for sorting replies, but I’m looking for how to sort topics from oldest to newest. Thanks again.

    @ritajoc this is exactly what my client wanted too. I found the answer here:

    http://wordpress.stackexchange.com/questions/135628/arrange-bbpress-topics-by-created

    Just needed to change the order from DESC to ASC. Add this following code to a plugin or your active theme’s functions.php file.

    function my_custom_display_topic_index_query () {
      $args['orderby'] = 'date';
      $args['order']   = 'ASC';
    
      return $args;
    }
    add_filter('bbp_before_has_topics_parse_args', 'my_custom_display_topic_index_query' );

    I just noticed that you should also pass the existing $args variable to the filter. For example I am just changing the sort order for a specific forum id.

    //* Change sort order of Topics within a specified bbpress forum
    function my_custom_display_topic_index_query ($args) {
      $thisforumid = bbp_get_forum_id();
    
      if($thisforumid == 43135) {
        $args['orderby'] = 'date';
        $args['order']   = 'ASC';
      }
    
      return $args;
    }
    add_filter('bbp_before_has_topics_parse_args', 'my_custom_display_topic_index_query ' );
Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Change sort order of latest-topics view?’ is closed to new replies.