Ascending posts not working?
-
I don’t know what I’m doing wrong, but sorting posts in a category to be ascending doesn’t seem to work.
Here are my snippets:
<?php if ( is_category() ) { $cat = get_query_var('cat'); query_posts(array('category__in' => array($cat), 'posts_per_page' => -1, 'orderby' => 'date', 'order' => 'ASC')); } if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php $args = array( 'category_name' => 'Category', 'posts_per_page' => 1, 'order_by' => 'date', 'order' => 'ASC' ); $args['order'] = 'ASC'; $my_query = new WP_Query($args); while ($my_query->have_posts()) { $my_query->the_post(); ?> <a href="<?php the_permalink(); ?>" title="Latest post">Latest post</a> <?php } ?>
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Ascending posts not working?’ is closed to new replies.