Arhhh, this is driving me nuts so any help would be really appreciated. In a custom page template I am trying to display a list of posts from a category with those posts that have sticky status to be first in the list of posts and then all other posts listed below but I can’t seem to get it to work. It either displays all posts, ignoring the sticky status or only shows the sticky posts.
Here’s the query:
<?php $temp = $wp_query; $wp_query = new WP_Query( array( 'posts_per_page' => '10', 'paged' => $paged, 'cat' => 275, 'post__in' => get_option('sticky_posts'))); while ($wp_query->have_posts()) : $wp_query->the_post(); ?>
- The topic ‘Sticky Posts in WP_Query’ is closed to new replies.