Home › Forums › Back End › Call get template part if condition is true? › Re: Call get template part if condition is true?
September 27, 2012 at 10:45 am
#110899
fectio1
Member
I figured it out. I had to use term_exist. Here is an example of my code.
$term = term_exists(‘your_category_name’, ‘category’);
if ($term !== 0 && $term !== null) {
get_template_part(‘gallery’);
}