I have a wordpress category archive for posts in the “press” category. Each category post is currently sorted by the WordPress publish date. Right now each post also has a “Press Date” field which lets the user post a date in a month year format like “May 2012”
I would like to sort the posts based on this Press Date instead. Here is my current code:
<?php query_posts('showposts=10000&cat=3'); if ( have_posts() ) : ?>
<?php while ( have_posts() ) : the_post(); ?>
<? $count = $count + 1; $clear = $count % 6; ?>
<a <? post_class("press-block"); ?> href="<? echo get('link');?>" target="_blank">
<? echo get_image ('press_image') ?>
<span class="press-info">
<? the_title(); ?>
<span><? echo get('publication_title'); ?></span>
<span><? echo get('press_date');?></span>
</span>
</a>
<?php endwhile; ?>
<?php else : ?>
No Posts Found
<?php endif; wp_reset_query(); ?>
To use custom fields/meta values to order the
query_posts resultyou can useFor more see Order & Orderby Parameters.