Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Mike Jolley

    (@mikejolley)

    Yep; Jobify theme does this.

    You can code it up yourself or try a 3rd party plugin like https://geomywp.com/add-ons/geo-job-manager/

    Add the following to your functions.php

    /* Create job maps */
     */
    	function the_job_map( $post = null ) {
    		$location = get_the_job_location( $post );
    
    		if ( $location ) {
    			echo apply_filters( 'the_job_location_map_link', '<a class="google_map_link" href="http://maps.google.com/maps?q=' . urlencode( $location ) . '&zoom=14&size=512x512&maptype=roadmap&sensor=false"><img class="google_map" src="http://maps.googleapis.com/maps/api/staticmap?center=' . urlencode( $location ) . '&markers=color:red%7C' . urlencode( $location ) . '&zoom=8&size=200x200&scale=2&maptype=roadmap&sensor=false"></a>', $location, $post );
    		}
    	}

    To display the map you can now use the following

    <?php the_job_map(); ?>

    If you want to tweak how the map looks you should focus on this part: ‘&zoom=14&size=512×512&maptype=roadmap&sensor=false’ Search Google how to customize the map some more.

    Edit: this will show an image (512px) of the map location. Why? Because I prefer an image instead of the whole interactive map. Especially with the small size of the map.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Google Map Integration’ is closed to new replies.