Created
July 17, 2015 16:42
-
-
Save cmg-jess/eb9433020cf817c5e7b8 to your computer and use it in GitHub Desktop.
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
/* [schemaaddress business='' streetaddress='' addresslocality='' addressregion='' postalcode='' telephone=''] */ | |
function schemaaddress_shortcode($atts) { | |
extract(shortcode_atts(array( | |
"business"=> '1', | |
"streetaddress"=> '2', | |
"addresslocality"=> '3', | |
"addressregion"=> '4', | |
"postalCode"=> '5', | |
"telephone"=> '6', | |
), $atts)); | |
$html='<div itemscope itemtype="http://schema.org/LocalBusiness"> | |
<span itemprop="name">'.$business.'</span> | |
<div itemprop="address" itemscope itemtype="http://schema.org/PostalAddress"> | |
<span itemprop="streetAddress">'.$streetaddress.'</span> | |
<span itemprop="addressLocality">'.$addresslocality.'</span>, | |
<span itemprop="addressRegion">'.$addressregion.'</span> | |
<span itemprop="postalCode">'.$postalcode.'</span> | |
<span itemprop="telephone">'.$telephone.'</span></div> | |
</div>'; | |
return $html; | |
} | |
add_shortcode("schemaaddress", "schemaaddress_shortcode"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment