Skip to content

Instantly share code, notes, and snippets.

@weslly
Created November 23, 2012 17:13
Show Gist options
  • Save weslly/4136520 to your computer and use it in GitHub Desktop.
Save weslly/4136520 to your computer and use it in GitHub Desktop.
Custom header snippet for wordpress
<?php
$defaults = array(
'default-image' => get_template_directory_uri() . '/assets/img/logo.png',
'flex-height' => true,
'flex-width' => true,
'width' => 280,
'height' => 70,
'header-text' => false,
'uploads' => true,
);
add_theme_support( 'custom-header', $defaults );
?>
<a class="brand" href="<?php echo home_url(); ?>/"><img src="<?php header_image(); ?>" height="<?php echo get_custom_header()->height; ?>" width="<?php echo get_custom_header()->width; ?>" alt="<?php bloginfo('name'); ?>" /></a>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment