Take the 2-minute tour ×  I am having two meta keys, longitude
and latitude, and what I am trying to do is the equivalent of
the google store location algorithm for distance, in wp_query:
What I am trying to do, is get a list of custom post types
(stores) that contain long/lat (custom fields), and having an x
distance (it's for a store locator, like google's example).  I
have already done it with $wpdb way, but I am looking for a
wp_query because I want the paging and the extra filtering by
using/removing an add_filter() directive to the page. Is it
possible to execute such complex query, or should I stick to
$wpdb method?  share|improve this question add comment  1 Answer
up vote 0 down vote accepted  You can do that. There are filters
available in WP_Query that enable you to modify the query just
as you like. The filter posts_clauses filters all of the parts
of the query together. There are also filters specific to the
parts of the query too. The best way to know about them is,
search posts_clauses in "w