Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_filter('the_posts', 'bump_sticky_posts_to_top');
- function bump_sticky_posts_to_top($posts) {
- foreach($posts as $i => $post) {
- if(is_sticky($post->ID)) {
- $stickies[] = $post;
- unset($posts[$i]);
- }
- }
- return array_merge($stickies, $posts);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement