I am currently running the below wordpress php and it is creating a list for me.
$term = get_term_by( 'id', $ptc, $taxonomy );
echo '<li><a href="'. home_url() .'/taxon/'. $pt->slug .'/' . $term->slug . '">' . $term->name . '</a> </li>';
However, I need it to check to see if $term is in_array $product_terms so I tried:
$term = get_term_by( 'id', $ptc, $taxonomy );
if(in_array($term, $product_terms)){
echo '<li class="current-cat"><a href="'. home_url() .'/taxon/'. $pt->slug .'/' . $term->slug . '">' . $term->name . '</a> </li>';
} else {
echo '<li><a href="'. home_url() .'/taxon/'. $pt->slug .'/' . $term->slug . '">' . $term->name . '</a> </li>';
}
But it still returns none with the extra class even though I know one of them is in the array... Any ideas how to make this work?