Title: shortcode not displaying properly
Last modified: August 30, 2016

---

# shortcode not displaying properly

 *  [vasilescu_anton](https://wordpress.org/support/users/vasilescu_anton/)
 * (@vasilescu_anton)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/shortcode-not-displaying-properly/)
 * I have a pretty unique situation where I need to embed the map into a html field
   of a gravity forms form, but the map is not displayed properly. After some digging
   it seems that the issue is due to javascript being embedded in an unordered list.
 * Here is a quick test page showing the issue:
    [http://okamotokitchen.com/map-test/](http://okamotokitchen.com/map-test/)
 * Any ideas how I could fix this?
    Thanks!
 * [https://wordpress.org/plugins/simple-google-maps-short-code/](https://wordpress.org/plugins/simple-google-maps-short-code/)

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

 *  Moderator [Pippin Williamson](https://wordpress.org/support/users/mordauk/)
 * (@mordauk)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/shortcode-not-displaying-properly/#post-6696491)
 * You will probably need to load the javascript manually. Are you familiar with
   how to do that?
 *  Thread Starter [vasilescu_anton](https://wordpress.org/support/users/vasilescu_anton/)
 * (@vasilescu_anton)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/shortcode-not-displaying-properly/#post-6696579)
 * not really but I can take directions 😀
 *  Moderator [Pippin Williamson](https://wordpress.org/support/users/mordauk/)
 * (@mordauk)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/shortcode-not-displaying-properly/#post-6696610)
 * Use Pluginception to create a new plugin: [https://wordpress.org/plugins/pluginception/](https://wordpress.org/plugins/pluginception/)
 * After creating a plugin, add this code to it:
 *     ```
       function custom_pw_map_load_scripts() {
       	wp_enqueue_script( 'google-maps-api', '//maps.google.com/maps/api/js?sensor=false' );
       }
       add_action( 'wp_enqueue_scripts', 'custom_pw_map_load_scripts' );
       ```
   
 *  Thread Starter [vasilescu_anton](https://wordpress.org/support/users/vasilescu_anton/)
 * (@vasilescu_anton)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/shortcode-not-displaying-properly/#post-6696626)
 * Unfortunately didn’t do anything, the page embedded shortcode displays properly
   while the form embedded one is not:
    [http://okamotokitchen.com/map-test/](http://okamotokitchen.com/map-test/)
 * My guess is that the JS code generated by the plugin doesn’t run because it’s
   embedded into a list item. Here is the source of the form embedded one:
 *     ```
       <div class='gform_body'><ul id='gform_fields_9' class='gform_fields top_label form_sublabel_below description_below'><li id='field_9_1' class='gfield gfield_html gfield_html_formatted gfield_no_follows_desc field_sublabel_below field_description_below' >		<div class="pw_map_canvas" id="pw_map_5637add0310df" style="height: 400px; width: 100%"></div>
       	<script type="text/javascript">
       		var map_pw_map_5637add0310df;
       		function pw_run_map_pw_map_5637add0310df(){
       			var location = new google.maps.LatLng("34.156972", "-118.437235");
       			var map_options = {
       				zoom: 15,
       				center: location,
       				scrollwheel: 1,
       				disableDefaultUI: 0,
       				mapTypeId: google.maps.MapTypeId.ROADMAP
       			}
       			map_pw_map_5637add0310df = new google.maps.Map(document.getElementById("pw_map_5637add0310df"), map_options);
       			var marker = new google.maps.Marker({
       			position: location,
       			map: map_pw_map_5637add0310df				});
       		}
       		pw_run_map_pw_map_5637add0310df();
       	</script>
       	</li>
       </ul></div>
       ```
   
 *  Thread Starter [vasilescu_anton](https://wordpress.org/support/users/vasilescu_anton/)
 * (@vasilescu_anton)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/shortcode-not-displaying-properly/#post-6696650)
 * Nobody has any ideas?
 *  Moderator [Pippin Williamson](https://wordpress.org/support/users/mordauk/)
 * (@mordauk)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/shortcode-not-displaying-properly/#post-6696654)
 * If you move it outside of a list item, does it work?
 *  Thread Starter [vasilescu_anton](https://wordpress.org/support/users/vasilescu_anton/)
 * (@vasilescu_anton)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/shortcode-not-displaying-properly/#post-6696658)
 * Yes it does, it’s what I’ve been trying to say in the original post. Here’s the
   link showing the upper one (outside the list) working while the lower one (inside
   the list) not working:
 * [http://okamotokitchen.com/map-test/](http://okamotokitchen.com/map-test/)
 * Thanks!
 *  Thread Starter [vasilescu_anton](https://wordpress.org/support/users/vasilescu_anton/)
 * (@vasilescu_anton)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/shortcode-not-displaying-properly/#post-6696674)
 * Still no ideas? I think what needs to happen is to have the JS removed from the
   plugin and added to the page first, but not sure how to achieve that due to the
   PHP intertwined in it…
 *  Moderator [Pippin Williamson](https://wordpress.org/support/users/mordauk/)
 * (@mordauk)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/shortcode-not-displaying-properly/#post-6696683)
 * I’m sorry but this is beyond the scope of what I can assist with at this time.
 * Loading the JS globally should resolve it.
 *  Thread Starter [vasilescu_anton](https://wordpress.org/support/users/vasilescu_anton/)
 * (@vasilescu_anton)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/shortcode-not-displaying-properly/#post-6696688)
 * Tried that already by modifying the plugin to load the JS in the footer of WordPress
   but to no avail…

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

The topic ‘shortcode not displaying properly’ is closed to new replies.

 * ![](https://ps.w.org/simple-google-maps-short-code/assets/icon-256x256.png?rev
   =1868328)
 * [Simple Shortcode for Google Maps](https://wordpress.org/plugins/simple-google-maps-short-code/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/simple-google-maps-short-code/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/simple-google-maps-short-code/)
 * [Active Topics](https://wordpress.org/support/plugin/simple-google-maps-short-code/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/simple-google-maps-short-code/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/simple-google-maps-short-code/reviews/)

 * 10 replies
 * 2 participants
 * Last reply from: [vasilescu_anton](https://wordpress.org/support/users/vasilescu_anton/)
 * Last activity: [10 years, 6 months ago](https://wordpress.org/support/topic/shortcode-not-displaying-properly/#post-6696688)
 * Status: not resolved