How to add maps to your site using template tags

Category:

User guides

Topic:

Working with maps

Maps can not only be displayed in posts or pages but anywhere on your blog in the header, footer, sidebar, etc. by adding a few lines of PHP code in the template file where you want the map to appear:

<?php echo do_shortcode('[mapsmarker map="1"]'); ?>

Where [mapsmarker map="1"] is the shortcode for map you would like to display (please adjust the ID to the map you want to display). Enter the shortcode exactly as you would type it into a post or page.

Tip 1: Be careful to put the whole shortcode in single quotes but the shortcode arguments in double quotes.

Tip 2: It’s a good idea to test the shortcode in a post or page first, before adding code to the template.


Updated on 29 May 2022