The quick and simple method might be to create a custom page template and have the search form send the user to the page that you create with it.
<?php
/*
Template Name: Location Results
*/
if ( isset($_REQUEST['search_field_name']) && !empty($_REQUEST['search_field_name']) ) {
# Read and escape the input data
# Do your query, grab your results
# Display your results to the user
} else {
# No results found. Display search form again with note to enter something.
}
You could then create a new page, selecting this page template and edit your form to send the results to it.
There are other ways to do this, but this is a fairly quick and easy method that I use now and again.
Related Posts:
- how to get this tax_query working?
- AJAX search on post pages by custom post type
- How to make a WP_Query search with custom post types?
- Search multiple custom fields by using meta_query
- How to put custom post types on front page
- How to add multiple images to a custom post type single post?
- Search Custom Post Type with all meta attached?
- How Do I Use WP_Query to Run This Database Query as Search Result?
- Custom Search form not working in localhost
- Group search results by post type, but hide post types with no results
- Search tags in CPTs
- How do I create an archive page for standard posts?
- Including Custom Meta with posts_where query
- Including metaboxes from custom post types in global search — continued
- How to have this permalink structure: post_type/postname/custom_inner_page
- Advanced search form with filters for custom taxonomies
- Custom WP_Query doesn’t display all posts
- Custom filter for main search: how to exclude specific post_type from search results
- WP_Query with custom post type ID
- Select2 AJAX and WP Query Returns ALL and does not filter
- find custom post type post by searching its custom field with my string
- Make Next and Previous on single-$posttype.php use the same order as archive-$posttype.php
- Get next and prev item from custom WP_Query and Custom Post Type
- Change search query in wordpress custom post type
- How to search through all child taxonomies using WP_Query?
- Search Function not searching correct custom_post_type even though post_type is defined in search args
- post_type incorrect for custom post type
- Live search by custom tag
- Create Second Search Page Only for Custom Post Type
- Why get_posts() returns empty array while I am trying to get posts from some specific taxonomies and work properly with others?
- Conditional posts in WP_query for search
- Loop carousel slider in wordpress
- Manually build WP_Query
- WP_Query with custom post type search showing all results every time
- Search form to find custom meta box generated data
- Custom post type blog pagination conflict
- Customising wordpress search and using $_GET[“s”]
- Why does ‘exclude_from_search’ exclude a custom post type from WP_Query?
- How to manage wordpress knowledge base/wiki/posts collections
- Searching Custom Posts content with JQuery
- WordPress search results grouped by post type
- Custom post archive with search, is_search() is false?
- Default WordPress Query for a Specific Custom Post Type URL
- Meta query with boolean true/false value
- category__in not working on custom post type
- Displaying Posts Related to Other Posts by a Taxonomy Term?
- Separating Search Results By Post Type
- WordPress Admin Panel search posts with custom post meta values along with title
- Date query for a custom meta field
- Querying Posts by Taxonomy From Alternate Network Site
- Set default option in dropdown of WP_Query?
- Is there An Input Checkbox Option That Works like `wp_dropdown_categories()` To Use In A WP Search Form?
- Combine tax_query and meta_query in WP_Query
- CPT Search Form with Taxonomy filter & Or
- Custom WP_Query not returning results when querying custom post type
- How to Get Current Custom Post Type Selected Taxonomy Term (Not All Terms)
- WP_Query: include custom post type only with specific meta value
- Allow non-logged in users to see a future post after clicking on a list of future posts
- Problem querying Custom post type by custom fields
- Query Multiple Custom Posts by Custom Fields
- How to Upload CSV Data into Custom Post Type Data with Metabox programmatically
- Include custom post type content in search
- Get post count for search result based on post type
- can these 3 queries be re-written as 1 query?
- cannot override post_types in WP_Query()
- Wrapping x posts in html without leaving empty html
- Loop for custom post types filtered by a taxonomy
- Loop increase number
- Is This Code Efficient – Or is there a better way?
- Api rest_route 404 while building filter for custom posts (filtered by multiple meta keys / custom fields)
- Custom post type’s posts are not showing anywere but in xml sitemap
- Custom post type and custom taxonomy 404 on page 2
- Can’t change posts per page in WordPress Post Type Query
- If Post type use sidebar (‘tree’)
- Ideas on how to organize a project [closed]
- Creating a Tabbed Widget
- Having Issue on Getting Metabox Checkbox Value
- Shortcode / WP_Query in post changes context
- Display custom-post type based on the Title matching the current selected value
- Modifying search results based on post_type
- Numeric pagination custom post type
- Query first and last name from custom post type
- Filter custom WP_Query by first letter of a custom field – hopefully using Search and Filter Pro?
- WP Query filter search. Result show all posts instead just custom post type
- Display posts of a hierarchical custom post type excluding parent posts
- custom search results – order results differently by post type
- get_post_meta for Custom Post Type ( CPT )
- WP_Query for CPT with filter by another WP_Query
- How to query posts by meta keys AND under specific category?
- Shortcode display CPT Query only showing 1 post?
- Query stopped working
- How can I base a query off of the current page post type AND a meta value from another custom post type
- WP_Query and two custom fields returns no posts
- Fallback if statement based on the number filtered from it
- Cannot get query var ‘post_type’ to work
- Change position of Post Formats box?
- Get images only from a certain post type
- Quering array of post types & pagination. Articles are repeating sometimes on different pages
- How can I show posts with the same tag?
- Load posts via AJAX without draft status