Make WordPress Core

Opened 15 years ago

Closed 15 years ago

#13666 closed defect (bug) (fixed)

"sticky" shouldn't be added to paged posts

Reported by: iandstewart's profile iandstewart Owned by:
Milestone: 3.0 Priority: normal
Severity: normal Version:
Component: Themes Keywords: has-patch
Focuses: Cc:

Description

Sticky posts are routinely styled by WordPress themers with the "sticky" class added to get_post_class if a post is sticky and it's in the blog loop (is_home). But, currently, that means paged posts are also getting "sticky" styles and appearing like "sticky" posts out of joint.

Attached is a diff checking to see if a post is paged before adding sticky to the array of post classes

Attachments (1)

paged-sticky-class.diff (423 bytes) - added by iandstewart 15 years ago.

Download all attachments as: .zip

Change History (5)

#1 @ryan
15 years ago

Stickies are only fetched in WP_Query::get_posts() if page <= 1, so I think this is safe.

#2 @ryan
15 years ago

That line was last changed when #7712 introduced is_home(). !is_paged() seems like a good addition.

#3 @ryan
15 years ago

  • Milestone changed from Unassigned to 3.0

#4 @ryan
15 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [15088]) Don't add sticky class if is_paged(). Props iandstewart. fixes #13666

Note: See TracTickets for help on using tickets.