Home Forums Front-end Issues Google map address Reply To: Google map address

  • The above was close… I’m crap with terminology so bear with me. The above doesn’t work because it won’t return the right stuff (see, crap with terminology 😉 )

    You have to create a variable for the location field so you can access the address array.

    $location = get_field(‘location’)
    $address = explode( “,” , $location[‘address’]);
    echo $address[0].'<br/>’; //place name
    echo $address[1].'<br/>’; // street address
    echo $address[2].’,’.$address[3]; // city, state zip

    This would display as (using your address example):
    Digiplex- Poway
    Poway Road
    Poway, CA

    I would just hard code the word “Location:” above this if you need it at all.

    If you do: print_r(explode( “,” , $location[‘address’]));

    You will get the array of information that is available from the address object, in case you want country or don’t want street address, etc. Obviously you can tweak the html to your needs when you echo out each thing.

    Hope this was helpful!

    definitely got me on the right path, so thanks dude!