Skip to:
Content
Pages
Categories
Search
Top
Bottom

Force Sticky Post Order


  • rngeer
    Participant

    @rngeer

    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

    @robin-w

    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

    @rngeer

    Giving that a shot, thank you.


    Robin W
    Moderator

    @robin-w

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


    rngeer
    Participant

    @rngeer

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

    No luck.


    Robin W
    Moderator

    @robin-w

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


    rngeer
    Participant

    @rngeer

    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

    @robin-w

    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

    @robin-w

    sorry, forget that, in wrong place


    Robin W
    Moderator

    @robin-w

    so do the stickies have any replies to them ?

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


    rngeer
    Participant

    @rngeer

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


    Robin W
    Moderator

    @robin-w

    🙂


    rngeer
    Participant

    @rngeer

    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

    @robin-w

    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

    @rngeer

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


    Robin W
    Moderator

    @robin-w

    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

    @rngeer

    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

    @robin-w

    🙂

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