- Timestamp:
- 11/30/2017 11:09:33 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-content/themes/twentyfourteen/inc/custom-header.php
r39226 r42343 36 36 * } 37 37 */ 38 add_theme_support( 'custom-header', apply_filters( 'twentyfourteen_custom_header_args', array( 39 'default-text-color' => 'fff', 40 'width' => 1260, 41 'height' => 240, 42 'flex-height' => true, 43 'wp-head-callback' => 'twentyfourteen_header_style', 44 'admin-head-callback' => 'twentyfourteen_admin_header_style', 45 'admin-preview-callback' => 'twentyfourteen_admin_header_image', 46 ) ) ); 38 add_theme_support( 39 'custom-header', apply_filters( 40 'twentyfourteen_custom_header_args', array( 41 'default-text-color' => 'fff', 42 'width' => 1260, 43 'height' => 240, 44 'flex-height' => true, 45 'wp-head-callback' => 'twentyfourteen_header_style', 46 'admin-head-callback' => 'twentyfourteen_admin_header_style', 47 'admin-preview-callback' => 'twentyfourteen_admin_header_image', 48 ) 49 ) 50 ); 47 51 } 48 52 add_action( 'after_setup_theme', 'twentyfourteen_custom_header_setup' ); 49 53 50 54 if ( ! function_exists( 'twentyfourteen_header_style' ) ) : 51 /** 52 * Styles the header image and text displayed on the blog 53 * 54 * @see twentyfourteen_custom_header_setup(). 55 * 56 */ 57 function twentyfourteen_header_style() { 58 $text_color = get_header_textcolor(); 55 /** 56 * Styles the header image and text displayed on the blog 57 * 58 * @see twentyfourteen_custom_header_setup(). 59 */ 60 function twentyfourteen_header_style() { 61 $text_color = get_header_textcolor(); 59 62 60 // If no custom color for text is set, let's bail. 61 if ( display_header_text() && $text_color === get_theme_support( 'custom-header', 'default-text-color' ) ) 62 return; 63 // If no custom color for text is set, let's bail. 64 if ( display_header_text() && $text_color === get_theme_support( 'custom-header', 'default-text-color' ) ) { 65 return; 66 } 63 67 64 // If we get this far, we have custom styles.65 ?>66 <style type="text/css" id="twentyfourteen-header-css">67 <?php68 // If we get this far, we have custom styles. 69 ?> 70 <style type="text/css" id="twentyfourteen-header-css"> 71 <?php 68 72 // Has the text been hidden? 69 73 if ( ! display_header_text() ) : … … 85 89 </style> 86 90 <?php 87 }91 } 88 92 endif; // twentyfourteen_header_style 89 93 90 94 91 95 if ( ! function_exists( 'twentyfourteen_admin_header_style' ) ) : 92 /**93 * Style the header image displayed on the Appearance > Header screen.94 *95 * @see twentyfourteen_custom_header_setup()96 *97 * @since Twenty Fourteen 1.098 */99 function twentyfourteen_admin_header_style() {100 ?>96 /** 97 * Style the header image displayed on the Appearance > Header screen. 98 * 99 * @see twentyfourteen_custom_header_setup() 100 * 101 * @since Twenty Fourteen 1.0 102 */ 103 function twentyfourteen_admin_header_style() { 104 ?> 101 105 <style type="text/css" id="twentyfourteen-admin-header-css"> 102 106 .appearance_page_custom-header #headimg { … … 123 127 } 124 128 </style> 125 <?php126 }129 <?php 130 } 127 131 endif; // twentyfourteen_admin_header_style 128 132 129 133 if ( ! function_exists( 'twentyfourteen_admin_header_image' ) ) : 130 /**131 * Create the custom header image markup displayed on the Appearance > Header screen.132 *133 * @see twentyfourteen_custom_header_setup()134 *135 * @since Twenty Fourteen 1.0136 */137 function twentyfourteen_admin_header_image() {138 ?>134 /** 135 * Create the custom header image markup displayed on the Appearance > Header screen. 136 * 137 * @see twentyfourteen_custom_header_setup() 138 * 139 * @since Twenty Fourteen 1.0 140 */ 141 function twentyfourteen_admin_header_image() { 142 ?> 139 143 <div id="headimg"> 140 144 <?php if ( get_header_image() ) : ?> … … 144 148 </div> 145 149 <?php 146 }150 } 147 151 endif; // twentyfourteen_admin_header_image
Note: See TracChangeset
for help on using the changeset viewer.