sticky posts to top of category page
-
I’m having a problem trying to do something that should be very simple. I want to display sticky posts at the top of category pages but keep the latest posts page chronological. I created a custom category.php file and have:
<?php $category_id = get_query_var('cat'); $the_query = new WP_Query( array( 'paged'=>get_query_var('paged'), 'ignore_sticky_posts' => 0, 'cat' => $category_id ) ); ?> <?php while($the_query->have_posts()) : $the_query->the_post(); ?>
It seems to me that if ignore_sticky_posts is 0 then sticky posts should NOT be ignored, ie they should be observed, but when I display category page the posts are chronological. Any help much appreciated.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘sticky posts to top of category page’ is closed to new replies.