- Timestamp:
- 11/25/2014 03:11:11 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-content/themes/twentyfifteen/inc/custom-header.php
r30564 r30567 12 12 * 13 13 * @uses twentyfifteen_header_style() 14 * @uses twentyfifteen_admin_header_image()15 14 */ 16 15 function twentyfifteen_custom_header_setup() { … … 31 30 * @type string $wp-head-callback Callback function used to styles the header image and text 32 31 * displayed on the blog. 33 * @type string $admin-preview-callback Callback function used to create the custom header markup in34 * the Appearance > Header screen.35 32 * } 36 33 */ … … 40 37 'height' => 1300, 41 38 'wp-head-callback' => 'twentyfifteen_header_style', 42 'admin-preview-callback' => 'twentyfifteen_admin_header_image',43 39 ) ) ); 44 40 } … … 173 169 } 174 170 endif; // twentyfifteen_header_style 175 176 if ( ! function_exists( 'twentyfifteen_admin_header_image' ) ) :177 /**178 * Custom header image markup displayed on the Appearance > Header admin panel.179 *180 * @since Twenty Fifteen 1.0181 * @see twentyfifteen_custom_header_setup().182 */183 function twentyfifteen_admin_header_image() {184 $style = sprintf( ' style="color: #%s;"', esc_attr( get_header_textcolor() ) );185 $color_scheme = twentyfifteen_get_color_scheme();186 $header_background_color = get_theme_mod( 'header_background_color', $color_scheme[1] );187 ?>188 <div id="headimg" style="background-image: url(<?php header_image(); ?>); background-color: <?php echo esc_attr( $header_background_color ); ?>;">189 <h1 class="displaying-header-text"><a id="name"<?php echo $style; ?> onclick="return false;" href="<?php echo esc_url( home_url( '/' ) ); ?>" tabindex="-1"><?php bloginfo( 'name' ); ?></a></h1>190 <div id="desc" class="displaying-header-text"<?php echo $style; ?>><?php bloginfo( 'description' ); ?></div>191 </div>192 <?php193 }194 endif; // twentyfifteen_admin_header_image195 171 196 172 /** … … 375 351 } 376 352 add_action( 'wp_enqueue_scripts', 'twentyfifteen_sidebar_text_color_css', 11 ); 377 378 /**379 * Enqueue styles to admin screen for custom header display.380 *381 * @since Twenty Fifteen 1.0382 */383 function twentyfifteen_admin_fonts() {384 wp_enqueue_style( 'twentyfifteen-fonts', twentyfifteen_fonts_url(), array(), null );385 wp_enqueue_style( 'twentyfifteen-custom-header', get_template_directory_uri() . '/css/admin-custom-header.css', array(), '20141010' );386 }387 add_action( 'admin_print_scripts-appearance_page_custom-header', 'twentyfifteen_admin_fonts' );
Note: See TracChangeset
for help on using the changeset viewer.