Created
January 11, 2014 13:32
-
-
Save bavington/8371007 to your computer and use it in GitHub Desktop.
Sample code for adding Schema.org markup to your website's company logo.
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
<div itemscope itemtype="http://schema.org/Organization"> | |
<?php | |
$attachment_id = 2; // Upload your client's logo to the Media Library and add the attachment ID here (swap the 2) | |
$image_attributes = wp_get_attachment_image_src( $attachment_id ); | |
?> | |
<a itemprop="url" href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home" id="logolink"> | |
<img itemprop="logo" src="<?php echo $image_attributes[0]; ?>" id="mainlogo" alt="<?php echo get_bloginfo ( 'description' ); ?>" /> | |
</a> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment