Can a Google Map be populated with data contained in a WordPress Category Archive? -
is possible insert google map wordpress category archive read of data in places on category page , create markers them?
i have directory site each place on site has been geocoded. places individual posts. organized categories city. output of each category page list of places city.
my urls this: example.com (homeapge) example.com/city (city archive page - shows list of places in db city) example.com/city/famous-restaurant (place detail page - shows data specific place in db)
i want create map once can put on top of example.com/city , show markers each listing have in db specific city. don't want have create individual maps each city.
i found this tutorial require xml dump of db on fly.
are there better ways accomplish this?
yes. you'd use combination of google maps api , get_posts()
https://developers.google.com/maps/documentation/javascript/overlays#markers
and
http://codex.wordpress.org/template_tags/get_posts
though, posts have have latitude , longitude stored them. otherwise, you'll need use part of google maps api places up...
Comments
Post a Comment