View difference between Paste ID: R9g38eRq and U39494n7
SHOW: | | - or go back to the newest paste.
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 = $termnews->count;
11+
$posts_in_testimonial = $termtestimonial->count;
12-
$posts_in_casestudy = $termnews->count;
12+
$posts_in_casestudy = $termcasestudy->count;
13
//conditionals to check if the term is true
14-
if ( $termnews == true && $posts_in_news >= 1 ) { //output the loop in here
14+
if ( $termnews == true && $posts_in_news >= 1 ) { 
15-
    
15+
//output the loop in here
16
}
17
18-
if ($termnews == true && $posts_in_testimonial >= 1 ) { //output the loop in here 
18+
if ($termnews == true && $posts_in_testimonial >= 1 ) { 
19-
    
19+
//output the loop in here 
20
}
21
22-
if ($termnews == true && $posts_in_casestudy >= 1) { //output the loop in here
22+
if ($termnews == true && $posts_in_casestudy >= 1) {
23-
    
23+
 //output the loop in here
24
}
25
26
?>