Advanced Custom Fields - Location Field add-on
How to use this - the easy way (7 posts)

  1. venkmanuk
    Posted 3 years ago #

    Hi there,

    just thought i'd post this because it was a headache trying to stitch together all the overly complicated documentation for this plugin + ACF.

    <?php if(get_field('googlemap'))
            <iframe width="400" height="300" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q=<?php echo the_field('googlemap'); ?>;t=m&z=10&iwloc=A&output=embed&iwloc=near"></iframe>


  2. gerhard
    Posted 3 years ago #

    Thanks man.. had a rough time until now to get this to display propperly :)

  3. shackep
    Posted 3 years ago #

    Make sure the field name matches the one you created. To make it clear, the two places where the above code has 'googlemap' you would use your own field. for example: get_field('your_location_field_here')

    Thanks venkmanuk.

  4. webpagedesign
    Posted 3 years ago #

    Awesome. This saved me so much time :D Thank you

  5. sally.wolleat
    Posted 3 years ago #

    Thank you for posting this!

  6. markthedoc
    Posted 3 years ago #

    Really useful, thanks for sharing this.

  7. souyi
    Posted 3 years ago #

    In first time, sorry my english.

    I used this for show a external link with mark of position in google maps.

    Inside the loop i created this for save the coordinates.

    $agenda = get_field('agenda_map');
    $coordinates = $agenda['coordinates'];

    next the google maps URL with the variable $coordinates

    <a href="https://www.google.es/maps?t=h&q=loc:<?php echo $coordinates; ?>&z=17" target="_blank"></a>

    Z parameter is the zoom. I hope that can be helpful.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Advanced Custom Fields - Location Field add-on
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.