Created
December 5, 2016 23:55
-
-
Save geoffgraham/1435e01e9f2861f7a4a432c367e3d043 to your computer and use it in GitHub Desktop.
The Events Calendar // Add Events to Main Blog Loop, with Custom Parameters
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
function my_custom_event_order( $query ) { | |
if ( $query->is_home() && $query->is_main_query() ) { | |
$query->set( 'post_type','tribe_events'); | |
$query->set( 'orderby','date'); | |
$query->set( 'order','DESC'); | |
return $query; | |
} | |
} | |
add_action( 'pre_get_posts', 'my_custom_event_order' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment