Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $categories = get_terms(array(gb_get_deal_cat_slug()),array('hide_empty'=>TRUE));
- echo '<div>';
- foreach ($categories as $category ) {
- $args=array(
- 'post_type' => gb_get_deal_post_type(),
- 'post_status' => 'any',
- 'posts_per_page' => 1, // return this many
- 'tax_query' => array(
- array(
- 'taxonomy' => gb_get_deal_cat_slug(),
- 'field' => 'id',
- 'terms' => $category->term_id,
- ) ),
- );
- $cat_deal = new WP_Query($args);
- if ($cat_deal->have_posts()) {
- while ($cat_deal->have_posts()) : $cat_deal->the_post();
- include(locate_template( 'inc/slider-browse-section.php' ));
- endwhile;
- }
- wp_reset_query();
- }
- echo '</div>';
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement