Categories
'dining', 'child_of' => 0, 'parent' => '', 'orderby' => 'name', 'order' => 'ASC', 'hide_empty' => 1, 'hierarchical' => 1, 'taxonomy' => 'offer_category', 'pad_counts' => false ); $categories = get_categories($args); echo '
    '; foreach ($categories as $category) { ?>
  • slug ? 'active-cat' : ''; ?>">name; ?>
  • All'; } echo '
'; ?>
'offer', 'posts_per_page'=> $offers_per_page, 'post_status' => 'publish', 'orderby' => array( 'meta_value_num' => 'ASC', 'date' =>'DESC' ), 'paged' => $cur_page, 'order' => 'ASC', 'meta_query' => array( 'relation' => 'AND', array( 'key' => 'offer_start_date', 'value' => current_time( 'timestamp' ), 'compare' => '<=' ), array( 'key' => 'offer_expire_date', 'value' => current_time( 'timestamp' ), 'compare' => '>=' ) ) ); if(isset($_GET['category'])){ $args["tax_query"] = array( array( 'taxonomy' => 'offer_category', 'field' => 'slug', 'terms' => $_GET['category'] ) ); } $offers = new WP_Query( $args ); $page_links_total = $offers->max_num_pages; $pagination_args = array( 'end_size' => 2, 'mid_size' => 2, 'format' => '?page=%#%', 'total' => $page_links_total, 'current' => $cur_page, 'prev_next' => true, 'type' => 'array' ); $offer_page = true; $page_links = paginate_links( $pagination_args ); if( $offers->have_posts() ){ ?>
Deals & Discounts