Hello!
I have created a live ajax search that goes through a custom post type called “Resources.” Currently I can search and filter the results using a drop down to select the category, and a searchbar that uses the input value to run a search query. These two can be used in tandem to refine the results.
However, I noticed that the search only looks through the title of the post type. Overall my query is:
​
$cat = $_POST[‘cat’];
$search = sanitize_text_field($_POST[‘s’]);
$resourceQuery = new WP_Query([
‘post_type’ => ‘report’,
‘posts_per_page’ => 10,
‘status’ => ‘publish’,
‘s’ => $search,
‘paged’ => $_POST[‘paged’],
‘tax_query’ => [
[
‘taxonomy’ => ‘report-categories’,
‘terms’ => $cat
]
],
‘order’ => ‘DESC’,
‘orderby’ => ‘date’
]);
​
I have tried searching for results but I cannot find anything that can help. Does anyone know a good resource to help me figure out how to include content and attachments to the search?
Thanks!
[ad_2]