Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Result Templating › Reply To: Result Templating
April 16, 2020 at 1:13 pm
#26770
Participant
Awesome!
I just tweaked it a little and the end result returns the category ID – which is fine enough for me to set my style according to the post’s category. For the benefit of everyone else who may require the same for their project, the code I used was:
<?php echo $r->content_type == 'pagepost' ? '' . implode('', wp_get_post_categories($r->id, array( 'name' => $cat->name, 'slug' => $cat->slug ))) : ''; ?>
Thanks again Ernest!