diff options
Diffstat (limited to 'themes/twentyfourteen/inc/custom-header.php')
-rw-r--r-- | themes/twentyfourteen/inc/custom-header.php | 96 |
1 files changed, 46 insertions, 50 deletions
diff --git a/themes/twentyfourteen/inc/custom-header.php b/themes/twentyfourteen/inc/custom-header.php index bfea8976..287b1068 100644 --- a/themes/twentyfourteen/inc/custom-header.php +++ b/themes/twentyfourteen/inc/custom-header.php @@ -35,40 +35,36 @@ function twentyfourteen_custom_header_setup() { * the Appearance > Header screen. * } */ - add_theme_support( - 'custom-header', apply_filters( - 'twentyfourteen_custom_header_args', array( - 'default-text-color' => 'fff', - 'width' => 1260, - 'height' => 240, - 'flex-height' => true, - 'wp-head-callback' => 'twentyfourteen_header_style', - 'admin-head-callback' => 'twentyfourteen_admin_header_style', - 'admin-preview-callback' => 'twentyfourteen_admin_header_image', - ) - ) - ); + add_theme_support( 'custom-header', apply_filters( 'twentyfourteen_custom_header_args', array( + 'default-text-color' => 'fff', + 'width' => 1260, + 'height' => 240, + 'flex-height' => true, + 'wp-head-callback' => 'twentyfourteen_header_style', + 'admin-head-callback' => 'twentyfourteen_admin_header_style', + 'admin-preview-callback' => 'twentyfourteen_admin_header_image', + ) ) ); } add_action( 'after_setup_theme', 'twentyfourteen_custom_header_setup' ); if ( ! function_exists( 'twentyfourteen_header_style' ) ) : - /** - * Styles the header image and text displayed on the blog - * - * @see twentyfourteen_custom_header_setup(). - */ - function twentyfourteen_header_style() { - $text_color = get_header_textcolor(); +/** + * Styles the header image and text displayed on the blog + * + * @see twentyfourteen_custom_header_setup(). + * + */ +function twentyfourteen_header_style() { + $text_color = get_header_textcolor(); - // If no custom color for text is set, let's bail. - if ( display_header_text() && $text_color === get_theme_support( 'custom-header', 'default-text-color' ) ) { - return; - } + // If no custom color for text is set, let's bail. + if ( display_header_text() && $text_color === get_theme_support( 'custom-header', 'default-text-color' ) ) + return; - // If we get this far, we have custom styles. - ?> - <style type="text/css" id="twentyfourteen-header-css"> - <?php + // If we get this far, we have custom styles. + ?> + <style type="text/css" id="twentyfourteen-header-css"> + <?php // Has the text been hidden? if ( ! display_header_text() ) : ?> @@ -88,20 +84,20 @@ if ( ! function_exists( 'twentyfourteen_header_style' ) ) : <?php endif; ?> </style> <?php - } +} endif; // twentyfourteen_header_style if ( ! function_exists( 'twentyfourteen_admin_header_style' ) ) : - /** - * Style the header image displayed on the Appearance > Header screen. - * - * @see twentyfourteen_custom_header_setup() - * - * @since Twenty Fourteen 1.0 - */ - function twentyfourteen_admin_header_style() { - ?> +/** + * Style the header image displayed on the Appearance > Header screen. + * + * @see twentyfourteen_custom_header_setup() + * + * @since Twenty Fourteen 1.0 + */ +function twentyfourteen_admin_header_style() { +?> <style type="text/css" id="twentyfourteen-admin-header-css"> .appearance_page_custom-header #headimg { background-color: #000; @@ -126,20 +122,20 @@ if ( ! function_exists( 'twentyfourteen_admin_header_style' ) ) : vertical-align: middle; } </style> - <?php - } +<?php +} endif; // twentyfourteen_admin_header_style if ( ! function_exists( 'twentyfourteen_admin_header_image' ) ) : - /** - * Create the custom header image markup displayed on the Appearance > Header screen. - * - * @see twentyfourteen_custom_header_setup() - * - * @since Twenty Fourteen 1.0 - */ - function twentyfourteen_admin_header_image() { - ?> +/** + * Create the custom header image markup displayed on the Appearance > Header screen. + * + * @see twentyfourteen_custom_header_setup() + * + * @since Twenty Fourteen 1.0 + */ +function twentyfourteen_admin_header_image() { +?> <div id="headimg"> <?php if ( get_header_image() ) : ?> <img src="<?php header_image(); ?>" alt=""> @@ -147,5 +143,5 @@ if ( ! function_exists( 'twentyfourteen_admin_header_image' ) ) : <h1 class="displaying-header-text"><a id="name" style="<?php echo esc_attr( sprintf( 'color: #%s;', get_header_textcolor() ) ); ?>" onclick="return false;" href="<?php echo esc_url( home_url( '/' ) ); ?>" tabindex="-1"><?php bloginfo( 'name' ); ?></a></h1> </div> <?php - } +} endif; // twentyfourteen_admin_header_image |