Skip to content

Instantly share code, notes, and snippets.

@neilgee
Forked from alana-mullen/function.php
Last active August 2, 2017 23:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save neilgee/d9439f60b60703a35a2d9564f4358598 to your computer and use it in GitHub Desktop.
Save neilgee/d9439f60b60703a35a2d9564f4358598 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>
<?php if ( function_exists( 'the_custom_logo' ) ) { ?>
<div itemscope itemtype="http://schema.org/Organization">
<?php the_custom_logo(); ?>
</div>
<?php } ?>
<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