Skip to content

Instantly share code, notes, and snippets.

@dlucero23
Created November 10, 2016 07:05
Show Gist options
  • Save dlucero23/f5e9eb3194cc7447242be3ed928fcd16 to your computer and use it in GitHub Desktop.
Save dlucero23/f5e9eb3194cc7447242be3ed928fcd16 to your computer and use it in GitHub Desktop.
(To be placed in the X child theme - /framework/views/global ) Remove all h1 tags that wrap the logo, to prevent the duplicate h1 tag error, which damages SEO. Also includes the alt tag in the link "Logo".
<?php
// VIEWS/GLOBAL/_BRAND.PHP
// -----------------------------------------------------------------------------
// Outputs the brand.
// =============================================================================
$site_name = get_bloginfo( 'name' );
$site_description = get_bloginfo( 'description' );
$logo = x_make_protocol_relative( x_get_option( 'x_logo' ) );
$site_logo = '<img src="' . $logo . '" alt="' . $site_description . '">';
?>
<a href="<?php echo home_url( '/' ); ?>" class="<?php x_brand_class(); ?>" title="<?php echo $site_description; ?>" alt="Logo">
<?php echo ( $logo == '' ) ? $site_name : $site_logo; ?>
</a>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment