Sort by post stamp date in paginated category is not working
-
I’m having a difficult time getting a category listing to show posts by time stamp. Right now it’s displaying posts in order of ID number.
Have I setup the following code correctly?
<?php $page = (get_query_var('paged')) ? get_query_var('paged') : 1; ?>
<?php if ( is_category('4') ) { query_posts("cat=4&showposts=20&paged=$page&orderby=date&order=DESC"); } ?>
<?php if ( is_category('6') ) { query_posts("cat=6&showposts=20&paged=$page&orderby=date&order=DESC"); } ?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<a href="<?php the_permalink(); ?>" id="item-<?php the_ID(); ?>">
<span class="product-title"><?php the_title(); ?></span>
</a>
<?php endwhile; else: ?>
<p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
<?php endif; ?>
- The topic ‘Sort by post stamp date in paginated category is not working’ is closed to new replies.