Skip to:
Content
Pages
Categories
Search
Top
Bottom

Custom sort replies in a topic


  • stevendo
    Participant

    @stevendo

    Hi there,

    My customer has a special requirement on reply sorting in a forum topic. We implemented a ‘mark as answer’ feature to mark a reply as the answer of the topic. This information is stored in postmeta table. Now we want to sort the replies in the topic in this order:
    – The original post appears at the first place.
    – The ‘marked as answer’ reply is in second place.
    – The remaining replies are sorted by date as normal.

    How to make that happen?

    Steven

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

  • Xevo
    Participant

    @xevo

    You’d have to edit the standard bbPress loop to put preference in an upvoted/marked answer above the rest. Seeing how it’s a custom post type it’s quite easy to do.


    stevendo
    Participant

    @stevendo

    Hi,

    I found my own solution to this requirement.
    All I need to do is to add a custom filter to this WordPress hook: posts_orderby_request.

    Steven


    stl99
    Participant

    @stl99

    Hi Steven,

    It sounds like you implemented something I’d like to have too for my bbPress forums.

    Please let me know if you’re interested in helping me to implement this on my website.

    Many thanks in advance for a speedy reply!

    Cheers,
    Thomas

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

You must be logged in to reply to this topic.