Adding a map to a page

You are here:

After you build your map, you can add it to any page or post on your WordPress site. There are 2 ways to do it:

  • Using a Shortcode
    It will work on all type of page builders and text widgets.
  • Using a Block
    In the new block editor (Gutenberg).

Shortcodes

Shortcodes in WordPress are little bits of code that allow you to add dynamic content to a page. Usually the shortcode will be replaced by some other content when you view the published page. Think of it as a shorter embed code.

Map shortcodes will looks like this:

[show-map id='102']

After you create your map and save it for the first time, a new box containing the shortcode will be added to the page, on the top right, in the sidebar.

Adding a map to a page

You can copy that small bit of code – the shortcode – and add it to your post or page where you want the map to display. If you’re using a page builder like Visual Composer or Elementor, you can add the shortcode in a text element. You can also add this shortcode to text widgets to display the map on the sidebar or footer of your page for example. The shortcode will be replaced by the actual map when you view the published page.

Map Block

If you’re using the block editor (Gutenberg) to create your page or post, you can simply select the Map block and select the map you have previously created.

Adding a map to a page

The map block can be found in the ‘Widgets’ section or you can simply search for ‘Map’.

Adding a map to a page

Once you select the map block, on the sidebar you’ll have a dropdown where you can select your previously created map.

And that’s it. You’ll get a preview of the map in the block editor and once you visit the page it will render the complete map.

Posted by Carlos Moreira

Lead developer of Interactive Geo Maps plugin.