Heer Makwana
Heer Makwana

Reputation: 905

Display Google Map into Wordpress site

I want to Display Google Map into my wordpress site.

I have used below script and also have include jquery-1.6.3.min.js, jquery.gomap-1.3.2.min.js jQueries, still I am not able to display Map.

   <script type="text/javascript">
      $(document).ready(function() {
      $('#map').goMap({
      width: 760px,
      height: 400px,
      address : '2200 NE 71st Ave Portland, OR, USA',
      latitude : 45,
      longitude : -122,
      zoom : 15
      }); // end goMap
      }); // end ready
    </script>
    <div id="map"></div>

Any suggestions or references would be very helpful.

Upvotes: 0

Views: 379

Answers (1)

Ajay Patel
Ajay Patel

Reputation: 5418

Write this shordcode function in your function.php file

//[gmap]
function gmap_func{
 $map = " <script type='text/javascript'>
      $(document).ready(function() {
      $('#map').goMap({
      width: 760px,
      height: 400px,
      address : '2200 NE 71st Ave Portland, OR, USA',
      latitude : 45,
      longitude : -122,
      zoom : 15
      }); // end goMap
      }); // end ready
    </script>
    <div id='map'></div>"
 return $map;
}
add_shortcode( 'gmap', 'gmap_func' );

And write [gmap] short code where you need to display it...

Upvotes: 1

Related Questions