cms tips

Get the latest sticky posts in WordPress
Published on December 23rd, 2010

If you want to feature some posts on your WordPress blog, sticky posts is the way to go. To get the latest sticky posts, find the loop and place this code before your Loop: $sticky = get_option(‘sticky_posts’); rsort( $sticky ); $sticky = array_slice( $sticky, 0, 5); query_posts( array( ‘post__in’ => $sticky, ‘caller_get_posts’ => 1 ) );