get sticky posts outisde the loop
-
Hi, i tried getting the sticky posts before the loop like this:
<?php /* Get all sticky posts */ $sticky = get_option( 'sticky_posts' ); /* Sort the stickies with the newest ones at the top */ rsort( $sticky ); /* Get the 5 newest stickies (change 5 for a different number) */ $sticky = array_slice( $sticky, 0, 5 ); /* Query sticky posts */ query_posts( array( 'post__in' => $sticky, 'caller_get_posts' => 1 ) ); ?>But when I do so the main loop is empty and no other posts are displayed.
Any ideas?
Thanks in advance,
Jogol
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘get sticky posts outisde the loop’ is closed to new replies.