have_posts() ASC and DESC
-
I have multiple categories. Some categories I would like to display ascending and others descending. Right now, I know how to make everything either ascending or descending. But am having a tough time figuring out how to add both. The logic is something like this:
<?php if (is_category('pastevents,photos')) {; ?> <?php query_posts($query_string . "&order=ASC"); ?> <?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> content stuff goes here <?php endwhile; ?> }elseif( is_category() ) { <?php query_posts($query_string . "&order=DESC"); ?> <?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> content stuff goes here <?php endwhile; ?> } <?php endif ?>
Am I getting close?
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘have_posts() ASC and DESC’ is closed to new replies.