Skip to content

Instantly share code, notes, and snippets.

@ammist
Created July 5, 2013 21:21
Show Gist options
  • Save ammist/5937338 to your computer and use it in GitHub Desktop.
Save ammist/5937338 to your computer and use it in GitHub Desktop.
<!-- replace the below with this -->
<a href="<?php echo esc_url( home_url( '/' ) ); ?>">
<?php if (is_category(1)){ ?>
<img src="http://asdfha.jpg" class="header-image" width="" height="" alt="Header 5" />
<?php } else {
$header_image = get_header_image(); ?>
<img src="<?php echo esc_url( $header_image ); ?>" class="header-image" width="<?php echo get_custom_header()->width; ?>" height="<?php echo get_custom_header()->height; ?>" alt="" />
<?php } ?>
</a>
/* this is the header.php file for twentytwelve, around line 48. Replace this code w/ the lines above */
<?php $header_image = get_header_image();
if ( ! empty( $header_image ) ) : ?>
<a href="<?php echo esc_url( home_url( '/' ) ); ?>"><img src="<?php echo esc_url( $header_image ); ?>" class="header-image" width="<?php echo get_custom_header()->width; ?>" height="<?php echo get_custom_header()->height; ?>" alt="" /></a>
<?php endif; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment