Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Custom Queries for Lotteries */
- /* usable when creating custom page template, not copy paste ready code - just custom query example! */
- // Return active lottery products.
- $args = array(
- 'fields' => 'ids',
- 'post_type'=> 'product',
- 'show_past_lottery' => FALSE,
- 'tax_query' => array(array('taxonomy' => 'product_type' , 'field' => 'slug', 'terms' => 'lottery')),
- );
- // Return past lottery products.
- $args = array(
- 'fields' => 'ids',
- 'post_type'=> 'product',
- 'show_past_lottery' => TRUE,
- 'tax_query' => array(array('taxonomy' => 'product_type' , 'field' => 'slug', 'terms' => 'lottery')),
- 'meta_query' => array(
- array(
- 'key' => '_lottery_closed',
- 'operator' => 'EXISTS',
- ),
- ),
- );
- $the_query = new WP_Query( $args );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement