Created
December 10, 2013 17:25
-
-
Save michaelschofield/7894479 to your computer and use it in GitHub Desktop.
Basic WP_Query() for ordering the loop by a custom field (i.e., start_date).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$args = array( | |
'meta_key' => 'start_date', | |
'orderby' => 'meta_value_num', | |
'post_type' => 'events' | |
); | |
$events = new WP_Query( $args ); | |
if ( $events->have_posts()) : while ( $events->have_posts()) : $events->the_post(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment