Google maps function without a plugin
-
Hi guys,
I need to implement Google maps into this website without using a plugin, though I have a custom written jscript function in my scripts.js.
Now i’m left puzzled on how to make this visual on wordpress. What I tried so far is this, and i’m not sure how to otherwise.
//Google Maps function gmaps_header(){ ?> <script type="text/javascript" src="https://maps.google.com/maps/api/js?sensor=false"></script> <?php } add_action('wp_head','gmaps_header'); function gmap() { if ( is_page('contact') ) { wp_register_script('initialize', ("". get_template_directory_uri() ."/scripts/script.js")); wp_enqueue_script('initialize'); } } add_action( 'wp_print_scripts', 'gmap');
- The topic ‘Google maps function without a plugin’ is closed to new replies.