i need to change the posts in taxonomy.php page. I have a meta_key which i want to compare to meta value. But currently my code is not returning anything. I am sure i am missing something. Please let me know what i am doing wrong!
add_action('pre_get_posts', 'add_event_date_criteria');
function add_event_date_criteria(&$query)
{
// We only want to filter on "public" pages
// You can add other selections, like here:
// - Only on a term page for our custom taxonomy
if (!is_admin() &&
is_tax('event-tag') || is_tax('event-category')) {
$query->set('meta_key', 'start_time');
$query->set('meta_compare', '>=');
$query->set('meta_value', time());
$query->set('meta_key', 'start_time');
$query->set('orderby', 'meta_value_num');
$query->set('order', 'ASC');
}
}