Open PHuhn opened 1 year ago
Thank you for reporting @PHuhn. I have been able to confirm in the latest version of Gutenberg and WordPress 6.2.2.
In the years that I have worked with WordPress, I have never used Sticky Post.
It's sad that this is still a problem. I see that the problem has existed for over ten years on Stack Overflow. In this issue over a year ago: 38979, it seems to disappear into a group of loop issues/fixes.
I ran into this recently and it is still reproducible on WordPress 6.4, Gutenberg 17.2+ and TT4.
Yeah, this actually seems to be "as intended", in a way. The WP_Query class will not load sticky posts if you're not is_home
. That should be true in classic themes as well. The query loop block takes no action on the query if you leave the default sticky setting, and that's going to have to change.
I think the "Include" sticky setting needs an explicit value set (right now it's value is empty), and that needs to trigger using post__in
in some block logic that currently lives in WordPress core.
As @ethanclevenger91 mentions, this is problem in core. I think we should close this one and and track this there (search for existing trac ticket or create a new one).
Description
Setting sticky bit on posts with a category show the post as if sticky is not set, that is sorted on the defined Ordered By.
Step-by-step reproduction instructions
Current version: 6.2.2
I have 4 categories, each category has ONE post with the sticky set. I created 4 pages each with a Query Loop with the Inherit query from template turned off, thus setting STICKY POSTS option to Include and Taxonomy of of the appropriate -category-.
On each page I expected the sticky post as the first post, but the posts were sorted on the defined Ordered By, which is Newest to Oldest.
Screenshots, screen recording, code snippet
Environment info
No response
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes