hook to modify archive's query
i’m building something similar to a store locator and got stuck right now.
i register a post type “places” and save latitude and longitude based an the google geocoding in two meta fields od theses posts. to keep everything as close as possible to wordpress core functions i want to modify the query of the archive page of “places” by a hook/filter to show nearest places based on a giving geoposition. so i registered queryvars “search_longitude” and “search_latitude” and a custom rewrite rule à la
http://example.com/places/12.34567/-12.34567/to pass the vars.
i found this plugin and its working sql statement, but i don’t know where exactly to modify the default behaviour of the standard archive page. i don’t want to put this into the archive-template, but rather do it earlier under the hood of the plugin.
must be something like the
pre_get_postshook i guess…
any help appreciated 🙂
- The topic ‘hook to modify archive's query’ is closed to new replies.