Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- global $post;
- //checks to see if the terms exist inside the cpt's
- $termnews = term_exists('homeone', 'news');
- $termtestimonial = term_exists('homeone', 'testimonial');
- $termcasestudy = term_exists('homeone', 'casestudy');
- //checks the amount of posts in each term
- $posts_in_news = $termnews->count;
- $posts_in_testimonial = $termtestimonial->count;
- $posts_in_casestudy = $termcasestudy->count;
- //conditionals to check if the term is true
- if ( $termnews == true && $posts_in_news >= 1 ) {
- //output the loop in here
- }
- if ($termnews == true && $posts_in_testimonial >= 1 ) {
- //output the loop in here
- }
- if ($termnews == true && $posts_in_casestudy >= 1) {
- //output the loop in here
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment