Home › Forums › General Issues › How can the following wp query be sorted by a custom field? › Reply To: How can the following wp query be sorted by a custom field?
Okey it returns the following text:
Contacto
string(473) "SELECT wp_posts.ID FROM wp_posts LEFT JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id) INNER JOIN wp_postmeta ON ( wp_posts.ID = wp_postmeta.post_id ) WHERE 1=1 AND ( wp_term_relationships.term_taxonomy_id IN (27) ) AND ( wp_postmeta.meta_key = 'region_contacto' ) AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish') GROUP BY wp_posts.ID ORDER BY wp_postmeta.meta_value+0 ASC, wp_posts.post_modified DESC LIMIT 0, 1"
Copiapó
[email protected]
[email protected]
+56 989025280
string(473) "SELECT wp_posts.ID FROM wp_posts LEFT JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id) INNER JOIN wp_postmeta ON ( wp_posts.ID = wp_postmeta.post_id ) WHERE 1=1 AND ( wp_term_relationships.term_taxonomy_id IN (29) ) AND ( wp_postmeta.meta_key = 'region_contacto' ) AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish') GROUP BY wp_posts.ID ORDER BY wp_postmeta.meta_value+0 ASC, wp_posts.post_modified DESC LIMIT 0, 1"
Curicó
CentroBudistaOtzerLingCuric%C%B
[email protected]
Subteniente Luis Cruz Martínez 812, Daya Center
+56 982494947
string(473) "SELECT wp_posts.ID FROM wp_posts LEFT JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id) INNER JOIN wp_postmeta ON ( wp_posts.ID = wp_postmeta.post_id ) WHERE 1=1 AND ( wp_term_relationships.term_taxonomy_id IN (25) ) AND ( wp_postmeta.meta_key = 'region_contacto' ) AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish') GROUP BY wp_posts.ID ORDER BY wp_postmeta.meta_value+0 ASC, wp_posts.post_modified DESC LIMIT 0, 1"
La Serena
BudismoOtzerLingSerena
[email protected]
Puyehue 611, Alto Peñuelas
+56 994038436
string(473) "SELECT wp_posts.ID FROM wp_posts LEFT JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id) INNER JOIN wp_postmeta ON ( wp_posts.ID = wp_postmeta.post_id ) WHERE 1=1 AND ( wp_term_relationships.term_taxonomy_id IN (24) ) AND ( wp_postmeta.meta_key = 'region_contacto' ) AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish') GROUP BY wp_posts.ID ORDER BY wp_postmeta.meta_value+0 ASC, wp_posts.post_modified DESC LIMIT 0, 1"
Santiago
CentroBudistaOtzerLing
[email protected]
Pasaje Traiguen 2420, 7500000 Providencia
+56 9997890
string(473) "SELECT wp_posts.ID FROM wp_posts LEFT JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id) INNER JOIN wp_postmeta ON ( wp_posts.ID = wp_postmeta.post_id ) WHERE 1=1 AND ( wp_term_relationships.term_taxonomy_id IN (22) ) AND ( wp_postmeta.meta_key = 'region_contacto' ) AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish') GROUP BY wp_posts.ID ORDER BY wp_postmeta.meta_value+0 ASC, wp_posts.post_modified DESC LIMIT 0, 1"
Valdivia
BudismoOtzerLingValdivia
[email protected]
BellaMente Valdivia, Carlos Anwandter 348
+56 977802320
string(473) "SELECT wp_posts.ID FROM wp_posts LEFT JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id) INNER JOIN wp_postmeta ON ( wp_posts.ID = wp_postmeta.post_id ) WHERE 1=1 AND ( wp_term_relationships.term_taxonomy_id IN (28) ) AND ( wp_postmeta.meta_key = 'region_contacto' ) AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish') GROUP BY wp_posts.ID ORDER BY wp_postmeta.meta_value+0 ASC, wp_posts.post_modified DESC LIMIT 0, 1"
Vicuña
OtzerlingVicuna
[email protected]
+56 965804128
string(473) "SELECT wp_posts.ID FROM wp_posts LEFT JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id) INNER JOIN wp_postmeta ON ( wp_posts.ID = wp_postmeta.post_id ) WHERE 1=1 AND ( wp_term_relationships.term_taxonomy_id IN (23) ) AND ( wp_postmeta.meta_key = 'region_contacto' ) AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish') GROUP BY wp_posts.ID ORDER BY wp_postmeta.meta_value+0 ASC, wp_posts.post_modified DESC LIMIT 0, 1"
Viña del Mar
BudismoOtzerLingVRegion
[email protected]
3 Poniente 441 local 14-A (entre 5 y 6 Norte), 2520164
+56 956188137
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!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.