Skip to:
Content
Pages
Categories
Search
Top
Bottom

Change "posting order"

  • @barabajen

    Member

    How do you change the order that replies ends up when reading a topic. Is it possible to change order of the replies, so that it shows the latest reply on top (reveresing order).

Viewing 13 replies - 1 through 13 (of 13 total)
  • @johnjamesjacoby

    Keymaster

    @BaraBajen – What version of bbPress are you using?

    @barabajen

    Member

    latest version, updated today

    @johnjamesjacoby

    Keymaster

    Are you using the plugin version for WordPress, or did you install it as a stand-alone piece of software?

    @barabajen

    Member

    Ah, sorry

    Im using the plugin version – or atleast my question is concerning the plugin version

    @johnjamesjacoby

    Keymaster

    It would take a small plugin to piggy-back on top of bbPress. It would hook into the ‘bbp_has_replies_query’ filter, and switch the ‘order’ argument from ‘ASC’ to ‘DESC’.

    Or, you can drop something like this in your functions.php file. (Note: Not tested, so this code might not actually work.) :)


    function bbp_reverse_reply_order( $query = array() ) {

    // Bail if no query
    if ( empty( $query ) ) return;

    // Change the order
    $query = 'DESC';

    // Return the adjusted query
    return $query;
    }
    add_filter( 'bbp_has_replies_query', 'bbp_reverse_reply_order' );

    @barabajen

    Member

    Hmmm… slightly over my head (as it seems).

    Is it possible to have this an option in admin – to mark if you want to have a certain topic or forum showing the replies in reverse order.

    @johnjamesjacoby

    Keymaster

    Anything is possible, but that’s plugin territory.

    @duncancox

    Member

    I am using this bbpress from last 6 months still I have not found any plugin regarding this. if You find it then please share with me.

    @alexrayan

    Participant

    To whomever wonders how to switch the order of replies. This filter actually works well, just the code needs to be modified to change the array value in $query[‘order’].

    function bbp_reverse_reply_order( $query = array() ) {
        $query['order']='DESC';
        return $query;
    }
    add_fiter('bbp_has_replies_query','bbp_reverse_reply_order');
    

    Hope, it helps someone.

    Regards,
    Alex

    @tapirk

    Participant

    Where do i put this filter. Now I’,m back to my mission again. Just had a short, one and half year brake. 🙂

    @mordauk

    Participant

    @Tapirk You need to create a new custom plugin and then paste the function into it. The easiest way to create a new custom plugin is to use Pluginception.

    @alexrayan

    Participant

    @tapirk Alternatively, you can also put this function with the filter into your theme’s functions.php file in case you don’t want to create a plugin.

    @rakeshcob

    Participant

    How to order replies with a meka_key value.

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