Skip to content

Instantly share code, notes, and snippets.

@woogist
Created March 14, 2014 09:42
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 woogist/9544879 to your computer and use it in GitHub Desktop.
Save woogist/9544879 to your computer and use it in GitHub Desktop.
change logo on shop page in canvas
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_shop() ){
$logo_url = 'i.perezhilton.com/wp-content/uploads/2013/12/zach-galifianakis-santa-claus-comedy-bang-bang.gif';
}
if ( is_ssl() ) $logo_url = str_replace( 'http://', 'https://', $logo_url );
echo '<a href="' . esc_url( $site_url ) . '" title="' . esc_attr( $site_description ) . '"><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 ) . '">' . $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