Filter the $wp_query->found_posts by cpt
-
This is a strange question, but I have two CPTs that I’m showing in the search results, and I want to show the number of each.
Is that possible?
Before using Relevanssi, I used this code:<?php $allsearch = new WP_Query("s=$s&showposts=0&post_type=listings"); echo '(' . $allsearch ->found_posts . ')'; ?>
And it worked well, but with Relevanssi, it doesn’t get any data.
So is there a way to filter like that your $wp_query->found_posts ??Thanks!!
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Filter the $wp_query->found_posts by cpt’ is closed to new replies.