Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: Hack: Google Maps for non-USA locations (and sites that only need 1 country)

  1. #1
    Thread Starter
    Rookie siam's Avatar
    Join Date
    Feb 2011
    Posts
    6
    Thanks
    0
    Thanked 3 Times in 1 Post

    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 &rsaquo;&rsaquo;','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 ~

  2. The Following 3 Users Say Thank You to siam For This Useful Post:

    abhi045 (January 30th, 2012), coza (November 17th, 2011), riadabdallah (March 26th, 2011)

  3. #2
    jomarkosabel's Avatar
    Join Date
    Mar 2009
    Location
    Philippines
    Posts
    35,547
    Thanks
    158
    Thanked 2,836 Times in 2,714 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!
    Please help our moderating team work more efficiently by not sending us support questions via PM. You can read more about how AppThemes support works here. However, you can send a PM to follow up and remind me if I missed your support request/thread.

    Thank you and have a nice day.

  4. #3
    Veteran cloudybright's Avatar
    Join Date
    Sep 2010
    Location
    Code Hell
    Posts
    590
    Thanks
    14
    Thanked 53 Times in 50 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  5. #4
    Thread Starter
    Rookie siam's Avatar
    Join Date
    Feb 2011
    Posts
    6
    Thanks
    0
    Thanked 3 Times in 1 Post
    You must be an AppThemes customer and logged in to view this response. Join today!

  6. #5
    Veteran cloudybright's Avatar
    Join Date
    Sep 2010
    Location
    Code Hell
    Posts
    590
    Thanks
    14
    Thanked 53 Times in 50 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  7. #6
    Member nicoschweinzer's Avatar
    Join Date
    Feb 2011
    Location
    Graz, Austria
    Posts
    65
    Thanks
    18
    Thanked 4 Times in 4 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  8. #7
    jomarkosabel's Avatar
    Join Date
    Mar 2009
    Location
    Philippines
    Posts
    35,547
    Thanks
    158
    Thanked 2,836 Times in 2,714 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!
    Please help our moderating team work more efficiently by not sending us support questions via PM. You can read more about how AppThemes support works here. However, you can send a PM to follow up and remind me if I missed your support request/thread.

    Thank you and have a nice day.

  9. The Following User Says Thank You to jomarkosabel For This Useful Post:

    riadabdallah (March 26th, 2011)

  10. #8
    Newbie noelclifden's Avatar
    Join Date
    Jan 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  11. #9
    jobsorbit's Avatar
    Join Date
    Mar 2011
    Location
    United States
    Posts
    83
    Thanks
    0
    Thanked 1 Time in 1 Post
    You must be an AppThemes customer and logged in to view this response. Join today!

  12. #10
    jobsorbit's Avatar
    Join Date
    Mar 2011
    Location
    United States
    Posts
    83
    Thanks
    0
    Thanked 1 Time in 1 Post
    You must be an AppThemes customer and logged in to view this response. Join today!

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Google maps
    By cazuk in forum Help Using ClassiPress
    Replies: 9
    Last Post: May 4th, 2011, 07:09 PM
  2. Google Maps
    By shatoony26 in forum Report ClassiPress Bugs
    Replies: 1
    Last Post: August 3rd, 2010, 03:57 AM
  3. Is it a spam to Google if I link my ClassiPress site to my other existing sites?
    By ejewelrysource in forum ClassiPress General Discussion
    Replies: 3
    Last Post: July 18th, 2010, 11:32 PM