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

#14328
andyunix
Participant

With the invaluable help of Chris, 🙂 🙂 we were able to find a solution to the problem, I’ll post the code:

//Cutom Mappress

function myiconid($iconid, $poi) {
global $post;
$postid = ($poi->postid) ? $poi->postid : $post->ID;
if (has_term(30, 'ad_cat', $postid) && get_post_type($postid) == 'ad_listing')
return 'icon.png';
;
return $iconid;
}
add_filter('mappress_poi_iconid', 'myiconid', 10, 2);

The parameters to be changed are: 30,(is id) ‘ad_cat'(is taxonomy) and ‘ad_listing'(is a post_type)

Best Regards and thanks to all!!!