- Timestamp:
- 11/30/2017 11:09:33 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-content/themes/twentythirteen/inc/custom-header.php
r36709 r42343 43 43 * %s is a placeholder for the theme template directory URI. 44 44 */ 45 register_default_headers( array( 46 'circle' => array( 47 'url' => '%s/images/headers/circle.png', 48 'thumbnail_url' => '%s/images/headers/circle-thumbnail.png', 49 'description' => _x( 'Circle', 'header image description', 'twentythirteen' ) 50 ), 51 'diamond' => array( 52 'url' => '%s/images/headers/diamond.png', 53 'thumbnail_url' => '%s/images/headers/diamond-thumbnail.png', 54 'description' => _x( 'Diamond', 'header image description', 'twentythirteen' ) 55 ), 56 'star' => array( 57 'url' => '%s/images/headers/star.png', 58 'thumbnail_url' => '%s/images/headers/star-thumbnail.png', 59 'description' => _x( 'Star', 'header image description', 'twentythirteen' ) 60 ), 61 ) ); 45 register_default_headers( 46 array( 47 'circle' => array( 48 'url' => '%s/images/headers/circle.png', 49 'thumbnail_url' => '%s/images/headers/circle-thumbnail.png', 50 'description' => _x( 'Circle', 'header image description', 'twentythirteen' ), 51 ), 52 'diamond' => array( 53 'url' => '%s/images/headers/diamond.png', 54 'thumbnail_url' => '%s/images/headers/diamond-thumbnail.png', 55 'description' => _x( 'Diamond', 'header image description', 'twentythirteen' ), 56 ), 57 'star' => array( 58 'url' => '%s/images/headers/star.png', 59 'thumbnail_url' => '%s/images/headers/star-thumbnail.png', 60 'description' => _x( 'Star', 'header image description', 'twentythirteen' ), 61 ), 62 ) 63 ); 62 64 } 63 65 add_action( 'after_setup_theme', 'twentythirteen_custom_header_setup', 11 ); … … 89 91 90 92 // If no custom options for text are set, let's bail. 91 if ( empty( $header_image ) && $text_color == get_theme_support( 'custom-header', 'default-text-color' ) ) 93 if ( empty( $header_image ) && $text_color == get_theme_support( 'custom-header', 'default-text-color' ) ) { 92 94 return; 95 } 93 96 94 97 // If we get this far, we have custom styles. … … 96 99 <style type="text/css" id="twentythirteen-header-css"> 97 100 <?php 98 if ( ! empty( $header_image ) ) : 99 ?> 101 if ( ! empty( $header_image ) ) : 102 ?> 103 .site-header { 104 background: url(<?php header_image(); ?>) no-repeat scroll top; 105 background-size: 1600px auto; 106 } 107 @media (max-width: 767px) { 100 108 .site-header { 101 background: url(<?php header_image(); ?>) no-repeat scroll top; 102 background-size: 1600px auto; 103 } 104 @media (max-width: 767px) { 105 .site-header { 106 background-size: 768px auto; 107 } 108 } 109 @media (max-width: 359px) { 110 .site-header { 111 background-size: 360px auto; 112 } 113 } 109 background-size: 768px auto; 110 } 111 } 112 @media (max-width: 359px) { 113 .site-header { 114 background-size: 360px auto; 115 } 116 } 114 117 <?php 115 118 endif; 116 119 117 120 // Has the text been hidden? 118 119 ?> 120 121 122 123 124 125 126 <?php 127 128 ?> 129 130 131 132 <?php 133 121 if ( ! display_header_text() ) : 122 ?> 123 .site-title, 124 .site-description { 125 position: absolute; 126 clip: rect(1px 1px 1px 1px); /* IE7 */ 127 clip: rect(1px, 1px, 1px, 1px); 128 } 129 <?php 130 if ( empty( $header_image ) ) : 131 ?> 132 .site-header .home-link { 133 min-height: 0; 134 } 135 <?php 136 endif; 134 137 135 138 // If the user has set a custom color for the text, use that. … … 162 165 if ( ! empty( $header_image ) ) { 163 166 echo 'background: url(' . esc_url( $header_image ) . ') no-repeat scroll top; background-size: 1600px auto;'; 164 } ?> 167 } 168 ?> 165 169 padding: 0 20px; 166 170 } … … 174 178 if ( ! empty( $header_image ) || display_header_text() ) { 175 179 echo 'min-height: 230px;'; 176 } ?> 180 } 181 ?> 177 182 width: 100%; 178 183 } … … 228 233 </div> 229 234 </div> 230 <?php } 235 <?php 236 }
Note: See TracChangeset
for help on using the changeset viewer.