Skip to:
Content
Pages
Categories
Search
Top
Bottom

Force Sticky Post Order

  • @rngeer

    Participant

    Hello, this is a request I have to force the order of two sticky posts so that they don’t change when a new comment is added.

    Sticky 1
    Sticky 2

    Sticky 2 will move above Sticky one with a new comment, and vice-versa.

    Any way in the code to force that sticky order to stay the same all the time.

    Thanks in advance.

Viewing 17 replies - 1 through 17 (of 17 total)
  • @robin-w

    Moderator

    order is determined usually by date – might be worth using the backend to change the date of one to be before or after the other.

    @rngeer

    Participant

    Giving that a shot, thank you.

    @robin-w

    Moderator

    if not then come back, but let me know how you are changing the order

    @rngeer

    Participant

    I tried it, made the Sticky 2 creation date more recent with changing the publish date.

    No luck.

    @robin-w

    Moderator

    o how are you changing the order, which is not sticking

    @rngeer

    Participant

    I was changing the main Forum Post Date that it was created to try that.

    These are two posts they want to have up at all times and add to them, just keep the order the same if they update either one.

    Might be beyond what the system can do at this point.

    @robin-w

    Moderator

    stickies should appear in date order early to late.

    ok so in dashboard>topics>edit topics and find the sticky topics and edit, do they have a ‘menu order’ set ?

    @robin-w

    Moderator

    sorry, forget that, in wrong place

    @robin-w

    Moderator

    so do the stickies have any replies to them ?

    that might alter the order, eg most recent reply determines order

    @rngeer

    Participant

    Apologies, just got to my office, trying these things now. Thank you for the help.

    @robin-w

    Moderator

    🙂

    @rngeer

    Participant

    Nada, just going to explain the nature of it to them and dig around later for a code hack if there is one. Thank you so much for the help.

    @robin-w

    Moderator

    line 322 of \includes\topics\template.php has the function I think

    you’d use a filter to add an ‘order by’ probably using the parse args on line 330

    so

    add_filter ('bbp_before_add_sticky_topics_parse_args' , 'your_function') ;
    
    function your_function ($r) {
    //add the order you want to sort
    $r['order_by'] = etc......
    
    }
    

    Sorry don’t have time to look at this evening, but come back if you need further help

    @rngeer

    Participant

    Yeah, not a great PHP guy here but taking a look.

    @robin-w

    Moderator

    ok, without knowing what is determining the order, it is hard to give you code to correct.

    I’d suggest you play with publish dates of the stickies and ant replies to them to see if you can work out the issue, then come back and I’ll see if I can help further

    @rngeer

    Participant

    Thank Robim, got a guy that can help. I appreciate all of the help on this. If I get a solid programming answer will let you guys know. Have a great weekend.

    @robin-w

    Moderator

    🙂

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