Created
January 9, 2019 22:13
-
-
Save kingkool68/7f586573bde9ef2b21f5d74c9f482627 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 action_pre_get_posts( $query ) { | |
if ( $query->is_tax() && $query->is_main_query() ) { | |
$meta_query = array( | |
array( | |
'key' => 'date', | |
'compare' => '>=', | |
'value' => date( 'Ymd' ), | |
), | |
); | |
$query->set( 'meta_query', $meta_query ); | |
} | |
} | |
add_action( 'pre_get_posts', 'action_pre_get_posts' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment