Created
November 27, 2017 14:45
-
-
Save zartgesotten/a17432a573f332377c4c90b1784510e4 to your computer and use it in GitHub Desktop.
Display address from address field not like:
mystreet 34, london, uk but like:
mystreet 34
London USAGE: [address id="2"]
UK
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php //Custom shortcode to add taxonomy image to Views | |
function getAddress_func( $atts ) { | |
$stadd = types_get_field_meta_value( 'standort-adresse', $atts['id'] ); | |
$stadd = str_replace (',','<br>',$stadd); | |
$stadd = str_replace ('Deutschland','',$stadd); | |
return $stadd; | |
} | |
add_shortcode( 'adresse', 'getAddress_func' ); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment