This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Reply To: check if posts are in custom taxonomy

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

#41610
kokosankokosan
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.