I have a page template where I call in a custom post type like so:

 $caseArgs = array(
  'post_type' => 'cases',
  'post_status' => 'publish',
  'posts_per_page' => -1,
  'order'    => 'DESC'

I then loop through the code on the page and echo out the results.

Would it be possible to have a search box on the same page where, if the user enters a keyword, then it triggers the $caseArgs to also include a category in the arguments, and then refreshes the content echod out below when finished?

Your Answer


Browse other questions tagged or ask your own question.