''), $atts ); $offer_id = $atts['offer_id']; $args = array( 'post_type' => 'offer' ); if($offer_id){ $args['p'] = (int)$offer_id; } $offers = new WP_Query( $args ); while($offers->have_posts()) : $offers->the_post(); $post_id = get_the_ID(); $offer_type = get_post_meta($post_id, "offer_type", true); if($offer_type == "deal"){ $link = get_post_meta($post_id, "deal_affiliate_link", true); }elseif($offer_type == "coupon"){ $coupon_type = get_post_meta($post_id, "coupon_type", true); if($coupon_type == "code"){ $link = get_post_meta($post_id, "coupon_store_link_with_code", true); $code = get_post_meta($post_id, "coupon_code", true); }else{ $link = get_post_meta($post_id, "coupon_sale_link", true); } } $trackingurl = $link == "" ? "#" : $link; $offer_store_id = get_post_meta($post_id, "store", true); $offer_expire_date = get_post_meta($post_id, "offer_expire_date", true); $offer_categories_name = get_the_terms($post_id, "offer_category"); if(!empty($offer_categories_name)){ foreach($offer_categories_name as $off_cat){ $categories_str .= $off_cat->name.", "; } } ?>
Expires in: Price: $ Coupon: Categories: