Adding sort order to main query
-
Hi all,
Given this code:
<?php if(have_posts()) : ?> <?php while(have_posts()) : ?> <?php the_post(); ?> <?php $last_name = get_post_meta( get_the_ID(), 'last_name', true ); $first_name = get_post_meta( get_the_ID(), 'first_name', true ); $short_title = get_post_meta( get_the_ID(), 'short_title', true ); $date = get_post_meta( get_the_ID(), 'date', true ); ?> <div class="site-width"> <div class="tax-desc"> <div class="theMainEntry"> <?php echo $last_name ?>, <?php echo $first_name ?>. <a href="<?php the_permalink(); ?>"><?php echo $short_title ?>...</a> <?php echo $date ?><p> </div> </div> </div><!-- post --> <?php endwhile; ?>
How can I sort (orderby) by $short_title, then by $date?
Thanks,
Mark
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Adding sort order to main query’ is closed to new replies.