Hack: Google Maps for non-USA locations (and sites that only need 1 country)
Just sharing this cuz it would have helped me if I read it.
For those sites not in the USA or who use regions/provinces instead of states:
1) Open sidebar-gmap.php in the /
wp-content/themes/classipress/includes directory
2) Change to this code:
Code:
// check to see if ad is legacy or not and then assemble the map address
if (get_post_meta($post->ID, 'location', true))
$make_address = get_post_meta($post->ID, 'location', true);
else
$make_address = get_post_meta($post->ID, 'cp_street', true) . ' ' . get_post_meta($post->ID, 'cp_city', true) . ' ' . get_post_meta($post->ID, 'cp_region', true) . ' ' . get_post_meta($post->ID, 'cp_country', true);
3) This will allow the Google Map sidebar to display correctly if you have setup your ClassiPress site "ad submission form" to use the Region/Country fields instead of US States/Country/ZIP Code fields. Most countries don't need the ZIP/Postal code for Google Maps to work correctly, and most countries don't really use such codes for purposes like this, so in my code it is removed.
4) If your site is only for one country, you can (should) remove the Country field from your "ad submission form" however it's best if you still include the Country somehow for the Google Maps API to function better.
5) Open step1.php in the /
wp-content/themes/classipress/includes/forms directory
6) Change to this code:
Code:
<p class="btn1">
<input type="hidden" id="cp_country" name="cp_country" value="YOURCOUNTRY">
<input type="submit" name="step1" id="step1" class="btn_orange" value="<?php _e('Continue ››','appthemes'); ?>" />
</p>
Note to ClassiPress team: It would be nice if future versions allowed webmasters to change Google Maps settings within the control panel, including a "default country" to append to the API query code. Cheers ~