Make WordPress Core

Opened 17 years ago

Closed 17 years ago

#11246 closed defect (bug) (duplicate)

Sticky Posts ignore post__not_in

Reported by: markjaquith Owned by: ryan
Priority: low Milestone:
Component: Query Version: 2.9
Severity: minor Keywords:
Cc: Focuses:

Description (last modified by markjaquith)

Doing a custom WP_Query on the is_home() page can result in sticky posts appearing in your result, even if you specifically excluded them with post__not_in

Sticky posts should honor post__not_in.

Change History (4)

#1 @markjaquith
17 years ago

  • Description modified (diff)

#2 @dd32
17 years ago

See: #11197 - claims fixed in 2.9?

#3 @scribu
17 years ago

Post 12 is sticky.

In index.php, added this code:

$posts = get_posts(array('post__not_in' => array(1, 12)));

$posts doesn't contain the post with ID 12, even though it's sticky.

#4 @scribu
17 years ago

  • Milestone Unassigned
  • Resolutionduplicate
  • Status newclosed

Anyway, it's a dupe.

Note: See TracTickets for help on using tickets.