Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › check if posts are in custom taxonomy › Reply To: check if posts are in custom taxonomy
March 2, 2023 at 10:04 pm
#41610
Participant
I can get it done now, somehting like this
add_filter( 'asp_results', 'asp_show_element_taxonomy', 10, 1 );
function asp_show_element_taxonomy( $results ) {
foreach ($results as $k=>&$r) {
$extext = get_post_meta($r->id, 'example_text', true);
if (has_term('', 'exampletaxonomies',$r->id))
$r->content = "<span>$extext</span><span>show this div</span>";
}
return $results;
}
Very awesome plugin, actually no need to create a separated custom post type to achieve this like I think before.