Opened 8 weeks ago
Last modified 8 weeks ago
#64712 new enhancement
Sticky Posts don't appear at top of Category / Taxonomy pages
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Awaiting Review | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | Posts, Post Types | Keywords: | close |
| Focuses: | Cc: |
Description (last modified by )
Originally opened as a Gutenberg issue:
https://github.com/WordPress/gutenberg/issues/51936
When viewing a category or taxonomy page - Sticky posts are not shown at the top of the list. This appears to be by design.
Yeah, this actually seems to be "as intended", in a way. The
WP_Queryclass will not load sticky posts if you're notis_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__inin some block logic that currently lives in WordPress core.
https://github.com/WordPress/gutenberg/issues/51936#issuecomment-2105414534
It would be good for the sticky settings to be honoured even in these circumstances.
This would be BC break if just impemented as the default behaviour for all archive pages or just for categories/taxonomy archives.
I suggest exploring a filter, an array with the archive types as key, posts as default true (for honouring sticky posts on the top). Such may, or may not, be included in core.
Or just close this, as concept of sticky posts in core are intended for the posts archive (home). There are already plugins for extending it to other archives https://github.com/wp-plugins/category-sticky-post.