How to add maps to your site using template tags

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 marker="1"]'); ?>

Where [mapsmarker marker="1"] is the shortcode for marker map you would like to display (please adjust the ID to the map you want to display). For layer maps please use [mapsmarker layer="1"] 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.