Last active
October 9, 2017 08:52
-
-
Save cubehrends/a7adf3aaf54a9036b54c64139565ee8a to your computer and use it in GitHub Desktop.
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
<?php | |
function event_pre_get_posts( $query ) { | |
// modify queries for 'event' post type only | |
if( isset( $query->query_vars['post_type'] ) && $query->query_vars['post_type'] == 'event' ) { | |
$query->set('orderby', 'meta_value'); | |
$query->set('meta_key', 'eventdetails_eventday_1'); | |
$query->set('order', 'ASC'); | |
} | |
return $query; | |
} | |
add_action('pre_get_posts', 'event_pre_get_posts'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment