Created
May 23, 2016 13:10
-
-
Save raajtram/7992d5d2fd5b8d0bc8f8fd5a0d4c91cf to your computer and use it in GitHub Desktop.
Google Maps Snippet (ACF Extras)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function page_map_sc() { | |
ob_start(); ?> | |
<?php if( get_field('my_map') ): ?> | |
<iframe width="600" height="450" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://maps.google.ca/maps?center=<?php the_field('my_map'); ?>&q=<?php the_field('my_map'); ?>&z=14&size=600x450&output=embed&iwloc=near"></iframe> | |
<?php endif; ?> | |
<? $output = ob_get_clean(); | |
return $output; | |
} | |
add_shortcode('my-google-map', 'simple_google_map'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment