Reply To: Icons per status/custom fields/taxonomy

Home Forums Feature Requests Icons per status/custom fields/taxonomy Reply To: Icons per status/custom fields/taxonomy

#13622
robbie59
Participant

Hello,

How can I use this code to check the value of a taxonomy of a custom post type?

function myiconid($iconid, $poi) {
if ($poi->postid && has_category('mycat1', $poi->postid))
return 'blue-dot';
else
return $iconid;
}
add_action('mappress_poi_iconid', myiconid);

The blow is not working for me:

function myiconid($iconid, $poi) {
if ($poi->postid && has_term('459_res','crimes', $poi->postid))
return 'assault.png';
else
return $iconid;
}
add_action('mappress_poi_iconid', myiconid);	
	

Thanks