Why is the post type on the search result page random?
Your problem is almost certainly that you’ve created a second query. That query is going to be out of sync with the main query, hence you are getting unexpected results. From what I can see, you aren’t really doing anything that the main query doesn’t already do, so I think you really only need the … Read more