I'm using sticky posts as features posts on home page. I'd like to limit the number of sticky posts to show two the latest two. I found this code, but it makes only on latest sticky post to show.
I'd appreciate your help.
<?php /* Get all sticky posts */ $sticky = get_option( 'sticky_posts' ); /* Sort the stickies with the newest ones at the top */ rsort( $sticky ); /* Get the 2 newest stickies (change 2 for a different number) */ $sticky = array_slice( $sticky, 0, 2 ); /* Query sticky posts */ query_posts( array( 'post__in' => $sticky, 'caller_get_posts' => 1 ) ); ?>