Home › Forums › ACF PRO › Google maps search › Reply To: Google maps search
You can always query the posts based on custom fields. This page should give you more idea about it: https://www.advancedcustomfields.com/resources/query-posts-custom-fields/.
You can use the $_GET variable for the search keyword and use it like this:
$posts = get_posts(array( 'numberposts' => -1, 'post_type' => 'cpt', 'meta_query' => array( 'relation' => 'AND', array( 'key' => 'google_map', 'value' => $_GET['location'], 'compare' => 'LIKE', ), ), ));
The URL should be something like this:
I hope this helps 🙂
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
CPT registration is coming to ACF! We demoed the new feature during the most recent session of ACF Chat Fridays. Check out the summary for the details. https://t.co/k2KQ3WWBAz— Advanced Custom Fields (@wp_acf) March 7, 2023
© 2023 Advanced Custom Fields.