I have a website that is integrated with Wordpress and the ACF plugin. I need some help writing an SQL statement to query the data I need. This is the statement so far
"SELECT ID, ( 3959 * acos(cos( radians( ".$_GET[lat]." ) ) * cos( radians( pm1.meta_value))
* cos( radians( pm2.meta_value ) - radians( ".$_GET[lng]." ) )
+ sin( radians( ".$_GET[lat]." ))
* sin( radians( pm1.meta_value) ) ) ) AS distance
LEFT JOIN wp_postmeta AS pm1
ON pm1.post_id = [login to view URL]
AND pm1.meta_key = 'latitude'
LEFT JOIN wp_postmeta AS pm2
ON pm2.post_id = [login to view URL]
AND pm2.meta_key = 'longitude'
HAVING distance <= ".$_GET[radius]."
ORDER BY distance ASC;"
This statement queries Wordpress posts and returns them in order of their distance using LAT/LONG co-ordinates.
I need to add some extra filters to this query. I need to also filter by:
- (ACF Field) event_start_date => today
- WP post status = published
That's it! Thank you.
I can provide help implementing the filters you need on your SQL query and also help implement PHP code to add filters accordingly based on user input if required. I have been a website developer for more than 6 years Daha Fazla
Bu iş için 20 freelancer ortalamada $134 teklif veriyor
I can help you out with adding extra filters etc to advanced custom field plugin and can start now . Let's talk over in chat and discuss there
HI,client. I 'm expert in Wordpress as well as the query expert. I can solve your problem quickly. please let's meet and then discuss more. thanks.
Hello I am very interested in your job. As a web development expert, especially wordpress expert who have enough experience, I can do your job enough as you want. I have used ACF(Advanced Custom Field) plugin. Being re Daha Fazla