Advertisement
kespinoza

how to query custom post type categories in multiple loops

May 3rd, 2014
255
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.97 KB | None | 0 0
  1. <div class="program-content span4">
  2. <?php /* Start first Loop */ ?>
  3. <?php
  4. $cat_id = get_cat_ID('11');
  5. $args=array(
  6. 'cat' => $cat_id,
  7. 'post_type' => 'program',
  8. 'post_status' => 'publish',
  9. 'posts_per_page' => -1,
  10. 'caller_get_posts'=> 1
  11. );
  12. $new = new WP_Query($cat_id);
  13.  
  14. while (have_posts()) : the_post(); ?>
  15. <h1 class="entry-title"><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h1>
  16. <?php the_content('Learn More >'); ?>
  17. <?php endwhile; ?>
  18. </div> <!-- .span4 -->
  19.  
  20. <div class="program-content span4">
  21. <?php /* Start second Loop */ ?>
  22. <?php
  23. $cat_id = get_cat_ID('12');
  24. $args=array(
  25. 'cat' => $cat_id,
  26. 'post_type' => 'program',
  27. 'post_status' => 'publish',
  28. 'posts_per_page' => -1,
  29. 'caller_get_posts'=> 1
  30. );
  31. $new = new WP_Query($cat_id);
  32.  
  33. while (have_posts()) : the_post(); ?>
  34. <h1 class="entry-title"><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h1>
  35. <?php the_content('Learn More >'); ?>
  36. <?php endwhile; ?>
  37. </div> <!-- .span4 -->
  38.  
  39. <div class="program-content span4">
  40. <?php /* Start third Loop */ ?>
  41. <?php
  42. $cat_id = get_cat_ID('13');
  43. $args=array(
  44. 'cat' => $cat_id,
  45. 'post_type' => 'program',
  46. 'post_status' => 'publish',
  47. 'posts_per_page' => -1,
  48. 'caller_get_posts'=> 1
  49. );
  50. $new = new WP_Query($cat_id);
  51.  
  52. while (have_posts()) : the_post(); ?>
  53. <h1 class="entry-title"><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h1>
  54. <?php the_content('Learn More >'); ?>
  55. <?php endwhile; ?>
  56. </div> <!-- .span4 -->
  57.  
  58. <?php else : ?> <?php endif; ?>
  59.  
  60. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement