daily pastebin goal
8%
SHARE
TWEET

Modify taxonomy.php to filter for custom date field value

a guest Feb 18th, 2013 422 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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 );
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top