Advertisement
Guest User

Modify taxonomy.php to filter for custom date field value

a guest
Feb 18th, 2013
573
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.57 KB | None | 0 0
  1.     $today = date( 'Y-m-d' );
  2.      
  3.     $term = $wp_query->query_vars['term'];
  4.      
  5.     $args = array(
  6.             'post_type' => 'bgmp',
  7.             'tax_query' => array(
  8.                 array(
  9.                     'taxonomy' => 'coupon',
  10.                     'field' => 'slug',
  11.                     'terms' => $term
  12.                 )
  13.             ),
  14.             'meta_query' => array(
  15.             array(
  16.                     'key' => 'coupon_end_date',
  17.                     'value' => $today,
  18.                     'compare' => '>=',
  19.                     'type' => 'DATETIME'
  20.             )
  21.             )
  22.             );
  23.         $the_query = new WP_Query( $args );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement