Opened 3 years ago

Closed 3 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:

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)

  • Description modified (diff)

comment:2   dd323 years ago

See: #11197 - claims fixed in 2.9?

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.

  • Milestone Unassigned deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Anyway, it's a dupe.

Note: See TracTickets for help on using tickets.