Make WordPress Core

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: jordesign's profile jordesign Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Posts, Post Types Keywords: close
Focuses: Cc:

Description (last modified by sabernhardt)

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_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.

https://github.com/WordPress/gutenberg/issues/51936#issuecomment-2105414534

It would be good for the sticky settings to be honoured even in these circumstances.

Change History (2)

#1 @knutsp
8 weeks ago

  • Keywords close added

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.

Last edited 8 weeks ago by knutsp (previous) (diff)

#2 @sabernhardt
8 weeks ago

  • Description modified (diff)
  • Version trunk deleted
Note: See TracTickets for help on using tickets.