WordPress database error: [Unknown column 'metalat.meta_value' in 'field list']SELECT SQL_CALC_FOUND_ROWS wp_posts.*, (
6371 * acos(
cos( radians( 39.381266 ) ) *
cos( radians( metalat.meta_value ) ) *
cos(
radians( metalong.meta_value ) - radians( -97.922211 )
) +
sin( radians( 39.381266 ) ) *
sin( radians( metalat.meta_value ) )
)
) as geo_distance
FROM wp_posts LEFT JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id)
WHERE 1=1 AND (
wp_posts.ID NOT IN (
SELECT object_id
FROM wp_term_relationships
WHERE term_taxonomy_id IN (7)
)
AND
wp_term_relationships.term_taxonomy_id IN (241)
) AND ((wp_posts.post_type = 'product' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'wc-partial')))
GROUP BY wp_posts.ID having geo_distance < 100
ORDER BY wp_posts.post_date DESC, wp_posts.ID DESC
LIMIT 0, 12