Get search results on custom page?
I want to query search results on a custom page.
Let's say I want to query all the results that are located in New York, with a radium of 20.
What is the proper way to query these results on my custom page?
I was able to create the piece of code below. This works, but I couldn't find a piece of code in the (parent) theme files where these custom args (location and radius) are defined. So I am not sure why it is working
Can maybe someone confirm that the below code is solid and point me to the piece of code where these are defined?
$cc_get_post_title = get_the_title();
$args = array(
'post_type' => 'listing',
'location' => $cc_get_post_title,
'radius' => '20',
'paged' => get_query_var( 'paged' )
// The Query
$the_query = new WP_Query( $args );