Skip to content

Instantly share code, notes, and snippets.

@alana-mullen
Last active August 24, 2018 06:52
Show Gist options
  • Save alana-mullen/50573108be4a1a1650b2239bce322f17 to your computer and use it in GitHub Desktop.
Save alana-mullen/50573108be4a1a1650b2239bce322f17 to your computer and use it in GitHub Desktop.
How to use Google's Organisation Logo Schema.org markup with WordPress Theme Logo
function mytheme_setup() {
add_theme_support('custom-logo');
}
add_action('after_setup_theme', 'mytheme_setup');
<div itemscope itemtype="http://schema.org/Organization">
<a itemprop="url" href="http://www.yourdomain.co.uk/">
<img itemprop="logo" src="http://www.yourdomain.co.uk/logo.png" alt="Company name" />
</a>
</div>
<div itemscope itemtype="http://schema.org/Organization">
<?php if ( function_exists( 'the_custom_logo' ) ) {
the_custom_logo();
} ?>
</div>
<div itemscope itemtype="http://schema.org/Organization">
<a href="https://www.thewirelessguy.co.uk/" class="custom-logo-link" rel="home" itemprop="url" tabindex="0">
<img width="249" height="56" src="https://www.thewirelessguy.co.uk/wp-content/uploads/2016/05/logo.png" class="custom-logo" alt="The Wireless Guy logo" itemprop="logo">
</a>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment