• Hi,

    i have this code:

    <?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 ) );
    ?>

    now it gives me only the sticky posts. But what if i want instead of the sticky post a certain category? Is this possible?

    beter explanation:
    Instead of getting all the sticky posts, i want to get all the posts in the category ‘news’

    Ifso,
    how should i do that?

    Thank you in advance

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Instead of Sticky Posts’ is closed to new replies.