strickdj / acf-field-address

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

Address Microformat #7

Open indianabenny opened 8 years ago

indianabenny commented 8 years ago

It would be great to set this up the option for this plugin to save and/or render code using the address/vcard microformat:

<address class="vcard"> <a class="url fn org" href="http://technorati.com/">Technorati</a> <span class="adr" style="display:block"> <span class="street-address">665 3rd St.</span> <span class="extended-address">Suite 207</span> <span style="display:block"> <span class="locality">San Francisco</span>, <span class="region">CA</span> <span class="postal-code">94107</span> </span> <span class="country-name">United States</span> </span> </address>

JennyWren commented 8 years ago

You can add your own if you want. Just pull out the data separately using the Array, and use this code to get started:

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