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

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

#5428
Ernest MarcinkoErnest Marcinko
Keymaster

Hi!

Well, I think the upper mentioned code won’t work, because the ‘auteur’ is not a meta field, but a taxonomy term.

Try something like:

[php]
<?php
// This is the taxonomy
$taxonomy = ‘auteur’;

// We only want to do this on posts/pages/custom post types
if ($r->content_type == ‘pagepost’) {
$terms = get_the_terms( $r->id, $taxonomy );
if (is_array($terms) && count($terms) > 0)
echo "<div class=’author’>" . $terms[0] . "</div>";
}
?>
[/php]