Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Call get template part if condition is true? Re: Call get template part if condition is true?

#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’);
}