WordPress.org

Forums

GD bbPress Tools
[resolved] Change sort order of latest-topics view? (9 posts)

  1. quan_flo
    Member
    Posted 1 year ago #

    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/

  2. Milan Petrovic
    Member
    Plugin Author

    Posted 1 year ago #

    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

  3. Milan Petrovic
    Member
    Plugin Author

    Posted 1 year ago #

    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

  4. RitaJoC
    Member
    Posted 1 year ago #

    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.

  5. SandyRig
    Member
    Posted 1 year ago #

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

  6. RitaJoC
    Member
    Posted 1 year ago #

    @SandyRig Thank you very much! I'll check it out.

  7. RitaJoC
    Member
    Posted 1 year ago #

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

  8. sunriseweb
    Member
    Posted 12 months ago #

    @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' );
  9. sunriseweb
    Member
    Posted 12 months ago #

    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 ' );

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic