Installed Plugin Version: Loading…
Using the Custom Shortcode plugin with the Google Code Playground to insert javascript into the content field.
- Steps to setting up the Custom Shortfield Plugin
- Install and activate the plugin in the Plugins panel
- Edit the Header.php (or the template file that contains your html <body> element) theme file under Appearance panel
- Add onload=”init()” to <body> to look like <body onload=”init()”> and click Save
- Edit or Create WordPress Page or Post and make sure it is published
- In the top right hand corner of the screen click Screen Options and ensure that the custom fields checkbox is checked
- Scroll down to custom fields, click enter new in the Name field write javascript and in the value field copy and paste the javascript including the api key from Google Code Playground into the field, then click Add Field
- Scroll up to the content field and click on the HTML tab, then insert
- Then go to the Google Code Playground, click on Edit HTML in the top right, then copy and paste the html that looks something like this <div id=”map3d” style=”width: 500px; height: 380px;”></div> onto the next line in the content field of your page or post
- Click on the Update/Publish button and view page. You should now have a functioning Google Earth API example running on your website that can be customized using code from the Playground and pasted in the Custom Field for each different page/post