Ticket #23336: 23336.2.diff
File 23336.2.diff, 781 bytes (added by , 12 years ago) |
---|
-
wp-includes/query.php
2743 2743 // Put sticky posts at the top of the posts array 2744 2744 $sticky_posts = get_option('sticky_posts'); 2745 2745 if ( $this->is_home && $page <= 1 && is_array($sticky_posts) && !empty($sticky_posts) && !$q['ignore_sticky_posts'] ) { 2746 $sticky_posts = array_slice( $sticky_posts, 0, apply_filters( 'sticky_posts_home_query_limit', 100 ) ); // sanity limit 2746 2747 $num_posts = count($this->posts); 2747 2748 $sticky_offset = 0; 2749 2748 2750 // Loop over posts and relocate stickies to the front. 2749 2751 for ( $i = 0; $i < $num_posts; $i++ ) { 2750 2752 if ( in_array($this->posts[$i]->ID, $sticky_posts) ) {