{"id":4501151,"date":"2014-01-14T09:13:23","date_gmt":"2014-01-14T09:13:23","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/google-maps-function-without-a-plugin\/"},"modified":"2016-08-21T14:44:28","modified_gmt":"2016-08-21T14:44:28","slug":"google-maps-function-without-a-plugin","status":"closed","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/google-maps-function-without-a-plugin\/","title":{"rendered":"Google maps function without a plugin"},"content":{"rendered":"<p>Hi guys, <\/p>\n<p>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. <\/p>\n<p>Now i&#8217;m left puzzled on how to make this visual on wordpress. What I tried so far is this, and i&#8217;m not sure how to otherwise.<\/p>\n<pre><code>\/\/Google Maps\nfunction gmaps_header(){\n?&gt;\n\t&lt;script type=&quot;text\/javascript&quot; src=&quot;http:\/\/maps.google.com\/maps\/api\/js?sensor=false&quot;&gt;&lt;\/script&gt;\n&lt;?php\n}\nadd_action(&#039;wp_head&#039;,&#039;gmaps_header&#039;);\n\nfunction gmap() {\nif ( is_page(&#039;contact&#039;) ) {\n\t    wp_register_script(&#039;initialize&#039;, (&quot;&quot;. get_template_directory_uri() .&quot;\/scripts\/script.js&quot;));\n\twp_enqueue_script(&#039;initialize&#039;); }\n}\nadd_action( &#039;wp_print_scripts&#039;, &#039;gmap&#039;);<\/code><\/pre>\n","protected":false},"template":"","class_list":["post-4501151","topic","type-topic","status-closed","hentry","topic-tag-custom-function","topic-tag-function","topic-tag-function-php","topic-tag-show-on-page"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/4501151","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/4501151\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=4501151"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}