Created
February 14, 2012 08:16
-
-
Save unix7/1824776 to your computer and use it in GitHub Desktop.
Genesis - Custom Header #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* functions.php */ | |
/** Add support for custom header */ | |
add_theme_support( 'genesis-custom-header', array( 'width' => 470, 'height' => 100, 'textcolor' => '444', 'admin_header_callback' => 'minimum_admin_style' ) ); | |
/** | |
* Register a custom admin callback to display the custom header preview with the | |
* same style as is shown on the front end. | |
* | |
*/ | |
function minimum_admin_style() { | |
$headimg = sprintf( '.appearance_page_custom-header #headimg { background: url(%s) no-repeat; font-family: Oswald, arial, serif; min-height: %spx; }', get_header_image(), HEADER_IMAGE_HEIGHT ); | |
$h1 = sprintf( '#headimg h1, #headimg h1 a { color: #%s; font-size: 48px; font-weight: normal; line-height: 48px; margin: 25px 0 0; text-decoration: none; }', esc_html( get_header_textcolor() ) ); | |
$desc = sprintf( '#headimg #desc { color: #%s; display: none; }', esc_html( get_header_textcolor() ) ); | |
printf( '<style type="text/css">%1$s %2$s %3$s</style>', $headimg, $h1, $desc ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment