Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › check if posts are in custom taxonomy › Reply To: check if posts are in custom taxonomy
March 2, 2023 at 4:43 pm
#41602
Participant
Hi, sorry for not being clear. The code below displays the div on every post. I want to display the div below only if a post has custom taxonomy “topic1”. In this case, use $r->content_type == 'pagepost' or 'term'?
<?php
if ($r->content_type == ‘pagepost’ ) {
?>
<div>show this div on the result if posts are in taxonomy “topic1″</div>
<?php
}
?>