WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. venkmanuk
    Member
    Posted 1 year 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>
            <?php
    	}
    	?>

    http://wordpress.org/extend/plugins/advanced-custom-fields-location-field-add-on/

  2. gerhard
    Member
    Posted 1 year ago #

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

  3. shackep
    Member
    Posted 1 year 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
    Member
    Posted 1 year ago #

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

  5. sally.wolleat
    Member
    Posted 1 year ago #

    Thank you for posting this!

  6. markthedoc
    Member
    Posted 1 year ago #

    Really useful, thanks for sharing this.

  7. souyi
    Member
    Posted 1 year 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

About this Topic

Tags

No tags yet.