Are you a GenerateCustomer?

Do you have an active GP Premium or GenerateBlocks Pro license key?

Create a GenerateSupport account for GeneratePress and GenerateBlocks support in one dedicated place.

Create an account
Already have a GenerateSupport account? Login

Just browsing?

Feel free to browse the forums. Support for our free versions is provided on WordPress.org (GeneratePress, GenerateBlocks).

Want to become a premium user? Learn more below.

Sticky posts not sticking to top of query loop

  • https://www.abcra.ca/heritage/

    The post from December 14 and the post from December 8 are set as “sticky” – but the NON-sticky post from December 13 is showing between them, instead of after, as intended. I’ve set the query parameter to include sticky posts. Not sure what else to try.

  • Hi there,

    Remove the sticky parameter, as it should stick by default, you do not need to add specific parameter for it.

  • You’re not understanding – those two “sticky” posts need to be next to one another – AND they need to stay at the top of the loop for a while (client’s request). They’re going to get bumped as soon as I add a new post with a more recent date from the looks of it – and certainly will if I remove sticky (though “sticky” isn’t working).

  • You are not understanding – have you tried removing the sticky posts parameter from the query loop?

    And what are the other parameters you added to the query loop?

  • Yes – I didn’t have it in there to begin with and it wasn’t working, so I tried adding it after reading some posts here that suggested that might help. I’ve taken it out again – still no joy. “Sticky” is being ignored.

  • That’s not the default behaviour.

    Do you have any functions that might interfere with the query loop?

    Can you disable all plugins except GP Premium and GB to test?

    Also if you are using a child theme, switch to the parent theme.

  • Exactly.

    The only functions I have enabled are Disable secondary menu mobile hamburger and Move search to secondary navigation – neither of which should make sticky not function (it’s working in other query loops, btw – though they’re both set to ONLY show sticky posts – the 2 in the “featured” area of the front page)

    I’ve deactivated all plugins except GPP, GB & GBP – still no joy.

    And not using a child theme.

  • Hi there,

    what are all the parameters you have set in the Query Loop ?

  • Just the Post Type->Posts, Taxonomies->Categories and the Term->Heritage. Nothing else.

  • OK, so Sticky Posts are exclusive to the main feed.
    WP doesn’t process them for other queries such as a taxonomy.
    All WP does is store the IDs of a sticky post in its own options array and appends them to the front of the main query,

    There was a plugin that used to handle Sticky Posts for Categories but its massively out of date.

    What you could do instead is create your own custom field ( eg. using ACF ) to store the “sticky post” value. And we can help with a custom query to sort those posts to the top.

  • Ah – that’s sort of what I suspected from a few things I’d read. Sigh. Ok – well I’ll circle back to this when I have a bit more time. The other option in this case is just bunging another query loop in there so that the three posts the client wants at the top are in that loop (with their own additional category to differentiate) – and everything else is below in the normal loop. I need to keep this as simple to understand as possible – because I am hoping we’re going to find someone other than *me* to maintain the content on this site. Thanks!

  • Yeah i think its best to pin down the UX first such as where does the user make the post “sticky” for a category. And then we can assist with any method you would like to display them in

  • Already done – just created a “featured Heritage” category and lobbed the three previously sticky posts in there. This is much easier for the client to understand – and some of those posts show up in other categories too, where we wouldn’t have wanted them to be sticky, so that would have been another can of worms anyway. Onward – and thanks!

  • Sounds like a great solution!!

Viewing 14 posts - 1 through 14 (of 14 total)
  • You must be logged in to reply to this topic.