Skip to content

Instantly share code, notes, and snippets.

@DustinHartzler
Created October 27, 2015 13:22
Show Gist options
  • Save DustinHartzler/85d022665734291efb0f to your computer and use it in GitHub Desktop.
Save DustinHartzler/85d022665734291efb0f to your computer and use it in GitHub Desktop.
function woo_logo () {
$settings = woo_get_dynamic_values( array( 'logo' => '' ) );
// Setup the tag to be used for the header area (`h1` on the front page and `span` on all others).
$heading_tag = 'span';
if ( is_home() || is_front_page() ) { $heading_tag = 'h1'; }
// Get our website's name, description and URL. We use them several times below so lets get them once.
$site_title = get_bloginfo( 'name' );
$site_url = home_url( '/' );
$site_description = get_bloginfo( 'description' );
?>
<div id="logo">
<?php
// Website heading/logo and description text.
if ( ( '' != $settings['logo'] ) ) {
$logo_url = $settings['logo'];
if ( is_ssl() ) $logo_url = str_replace( 'http://', 'https://', $logo_url );
echo '<a href="' . esc_url( $site_url ) . '" title="' . esc_attr( $site_description ) . '" target="_blank"><img src="' . esc_url( $logo_url ) . '" alt="' . esc_attr( $site_title ) . '" /></a>' . "\n";
} // End IF Statement
echo '<' . $heading_tag . ' class="site-title"><a href="' . esc_url( $site_url ) . '" target="_blank">' . $site_title . '</a></' . $heading_tag . '>' . "\n";
if ( $site_description ) { echo '<span class="site-description">' . $site_description . '</span>' . "\n"; }
?>
</div>
<?php
} // End woo_logo()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment