MvdP
Forum Replies Created
-
I am running into the same problem.
Did someone found a solution to the problem?
Thanks.
Thanks agelonwl.
I have seen that page but what happens in that case is that you can only customize what happens inside of the loop.
I would like to be able to create a whole different template file for the page so that I will be able to create a whole different page for it. Same as I accomplished for the locations page by creating theme_folder/single-location.php
Forum: Fixing WordPress
In reply to: Sql with multiple post_meta statementsIf one is interested in the produced final query it looks like this:
SELECT SQL_CALC_FOUND_ROWS wp_posts.* FROM wp_posts INNER JOIN wp_postmeta ON (wp_posts.ID = wp_postmeta.post_id) INNER JOIN wp_postmeta AS mt1 ON (wp_posts.ID = mt1.post_id) WHERE 1=1 AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish') AND ( (wp_postmeta.meta_key = 'lat' AND CAST(wp_postmeta.meta_value AS SIGNED) BETWEEN '55' AND '65') AND (mt1.meta_key = 'long' AND CAST(mt1.meta_value AS SIGNED) BETWEEN '20' AND '30') ) GROUP BY wp_posts.ID ORDER BY wp_posts.post_date DESC LIMIT 0, 10
Forum: Fixing WordPress
In reply to: Sql with multiple post_meta statements@keesiemeijer you are my hero!
Sometimes the answer can be so simple… yet so hard. Totally over thought this whole thing. Sometimes it’s the simpleness that does the job!
Thanks a lot!!
Forum: Fixing WordPress
In reply to: Sql with multiple post_meta statementsYes I have looked at the meta_query.
My example query was a bit wrong it should be something like this i think:
`SELECT
wp_posts.*
INNER JOIN
wp_postmeta
FROM
wp_postmeta
WHERE
(
(meta_key = ‘lat’ AND meta_value >= ’55’)
OR
(meta_key = ‘lat’ AND meta_value <= ’65’)
)
AND
(
(meta_key = ‘long’ AND meta_value >= ’20’)
OR
(meta_key = ‘long’ AND meta_value <= ’30’)
)
GROUP BY
post_id’