Guest User

Untitled

a guest
Jun 12th, 2013
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. global $post;
  3.  
  4. //checks to see if the terms exist inside the cpt's
  5. $termnews = term_exists('homeone', 'news');
  6. $termtestimonial = term_exists('homeone', 'testimonial');
  7. $termcasestudy = term_exists('homeone', 'casestudy');
  8.  
  9. //checks the amount of posts in each term
  10. $posts_in_news = $termnews->count;
  11. $posts_in_testimonial = $termtestimonial->count;
  12. $posts_in_casestudy = $termcasestudy->count;
  13. //conditionals to check if the term is true
  14. if ( $termnews == true && $posts_in_news >= 1 ) {
  15. //output the loop in here
  16. }
  17.  
  18. if ($termnews == true && $posts_in_testimonial >= 1 ) {
  19. //output the loop in here
  20. }
  21.  
  22. if ($termnews == true && $posts_in_casestudy >= 1) {
  23. //output the loop in here
  24. }
  25.  
  26. ?>
Advertisement
Add Comment
Please, Sign In to add comment