Reply To: Problem with searching in custom post

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Problem with searching in custom post Reply To: Problem with searching in custom post

#5424

tim
Participant

Great! Works perfect now.

Another little (or not) question: is it possible to show in the results the title and the custom taxonomy “auteur” (author)? I've already played a bit with this: https://wp-dreams.com/knowledge-base/result-templating/ but I don't get it working for taxonomy terms.

Can I just use

<?php
// This is the meta key
$key = 'auteur';
 
// We only want to do this on posts/pages/custom post types
if ($r->content_type == 'publicatie') {
  $meta_value = get_post_meta( $r->id, $key, true );
  if ($meta_value != ”)
    echo "<div class='author'>" . $meta_value . "</div>";
}
?>
 
<?php if ($s_options['showdescription'] == 1): ?>
 
    <?php echo $r->content; ?>
 
<?php endif; ?>

Or more something like “get_object_taxonomies”

or not?

Thanks!

Tim