Advertisement
Guest User

Untitled

a guest
May 21st, 2014
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. <?php
  2. $categories = get_terms(array(gb_get_deal_cat_slug()),array('hide_empty'=>TRUE));
  3. echo '<div>';
  4. foreach ($categories as $category ) {
  5. $args=array(
  6. 'post_type' => gb_get_deal_post_type(),
  7. 'post_status' => 'any',
  8. 'posts_per_page' => 1, // return this many
  9. 'tax_query' => array(
  10. array(
  11. 'taxonomy' => gb_get_deal_cat_slug(),
  12. 'field' => 'id',
  13. 'terms' => $category->term_id,
  14. ) ),
  15. );
  16. $cat_deal = new WP_Query($args);
  17. if ($cat_deal->have_posts()) {
  18. while ($cat_deal->have_posts()) : $cat_deal->the_post();
  19. include(locate_template( 'inc/slider-browse-section.php' ));
  20.  
  21. endwhile;
  22. }
  23. wp_reset_query();
  24. }
  25. echo '</div>';
  26. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement