strickdj / acf-field-address

address field addon for Advanced Custom Fields (ACF)
Other
47 stars 18 forks source link

Address Schema #16

Closed JennyWren closed 8 years ago

JennyWren commented 8 years ago

Any way I can pull out the pieces of the address and wrap them in schema? I would also like to pull out the address with no markup to create my own easy search link to google (i.e. google.com/maps/?q=Address with spaces).

JennyWren commented 8 years ago

Nevermind, I figured it out. Choose Array in field settings (not HTML or Object) and use the following code:

$address    = get_field( 'full_address', 'option' );
printf( '<div class="address">%s<br> %s, %s %s</div>', $address["street1"], $address["city"], $address["state"], $address["zip"] );