Search result based on URL

You don’t and shouldn’t rely on referrers ( they can be stripped, hidden, or just outright lies ) Instead there are alternatives such as submitting to the post type archive: <form action=”/courses” method=”get”> <input type=”test” name=”s”/> </form> Or bundling query vars as hidden inputs: <form action=”” method=”get”> <input type=”test” name=”s”/> <input type=”hidden” name=”post_type” value=”course” /> … Read more

WP_Query with all posts in one custom post type and only posts in another custom post type with a specific category

I’m going to take the answer you posted for yourself and suggest a couple of improvements. Some things I’ll address: The 3rd query is unnecessary. There are simpler ways to sort by date. Just make both queries for the full post content and merge the results. Since we’re not going to be using have_posts() and … Read more