wp/wp-content/themes/twentythirteen/inc/custom-header.php
changeset 5 5e2f62d02dcd
parent 0 d970ebf37754
child 7 cf61fcea0001
--- a/wp/wp-content/themes/twentythirteen/inc/custom-header.php	Mon Jun 08 16:11:51 2015 +0000
+++ b/wp/wp-content/themes/twentythirteen/inc/custom-header.php	Tue Jun 09 03:35:32 2015 +0200
@@ -2,7 +2,7 @@
 /**
  * Implement a custom header for Twenty Thirteen
  *
- * @link http://codex.wordpress.org/Custom_Headers
+ * @link https://codex.wordpress.org/Custom_Headers
  *
  * @package WordPress
  * @subpackage Twenty_Thirteen
@@ -19,8 +19,6 @@
  * @uses register_default_headers() to set up the bundled header images.
  *
  * @since Twenty Thirteen 1.0
- *
- * @return void
  */
 function twentythirteen_custom_header_setup() {
 	$args = array(
@@ -68,15 +66,13 @@
  * Load our special font CSS files.
  *
  * @since Twenty Thirteen 1.0
- *
- * @return void
  */
 function twentythirteen_custom_header_fonts() {
 	// Add Source Sans Pro and Bitter fonts.
 	wp_enqueue_style( 'twentythirteen-fonts', twentythirteen_fonts_url(), array(), null );
 
 	// Add Genericons font.
-	wp_enqueue_style( 'genericons', get_template_directory_uri() . '/fonts/genericons.css', array(), '2.09' );
+	wp_enqueue_style( 'genericons', get_template_directory_uri() . '/genericons/genericons.css', array(), '3.03' );
 }
 add_action( 'admin_print_styles-appearance_page_custom-header', 'twentythirteen_custom_header_fonts' );
 
@@ -86,8 +82,6 @@
  * get_header_textcolor() options: Hide text (returns 'blank'), or any hex value.
  *
  * @since Twenty Thirteen 1.0
- *
- * @return void
  */
 function twentythirteen_header_style() {
 	$header_image = get_header_image();
@@ -107,6 +101,16 @@
 			background: url(<?php header_image(); ?>) no-repeat scroll top;
 			background-size: 1600px auto;
 		}
+		@media (max-width: 767px) {
+			.site-header {
+				background-size: 768px auto;
+			}
+		}
+		@media (max-width: 359px) {
+			.site-header {
+				background-size: 360px auto;
+			}
+		}
 	<?php
 		endif;
 
@@ -144,8 +148,6 @@
  * Style the header image displayed on the Appearance > Header admin panel.
  *
  * @since Twenty Thirteen 1.0
- *
- * @return void
  */
 function twentythirteen_admin_header_style() {
 	$header_image = get_header_image();
@@ -212,16 +214,17 @@
  * This callback overrides the default markup displayed there.
  *
  * @since Twenty Thirteen 1.0
- *
- * @return void
  */
 function twentythirteen_admin_header_image() {
+	$style = 'color: #' . get_header_textcolor() . ';';
+	if ( ! display_header_text() ) {
+		$style = 'display: none;';
+	}
 	?>
-	<div id="headimg" style="background: url(<?php header_image(); ?>) no-repeat scroll top; background-size: 1600px auto;">
-		<?php $style = ' style="color:#' . get_header_textcolor() . ';"'; ?>
+	<div id="headimg" style="background: url(<?php echo esc_url( get_header_image() ); ?>) no-repeat scroll top; background-size: 1600px auto;">
 		<div class="home-link">
-			<h1 class="displaying-header-text"><a id="name"<?php echo $style; ?> onclick="return false;" href="#"><?php bloginfo( 'name' ); ?></a></h1>
-			<h2 id="desc" class="displaying-header-text"<?php echo $style; ?>><?php bloginfo( 'description' ); ?></h2>
+			<h1 class="displaying-header-text"><a id="name" style="<?php echo esc_attr( $style ); ?>" onclick="return false;" href="#" tabindex="-1"><?php bloginfo( 'name' ); ?></a></h1>
+			<h2 id="desc" class="displaying-header-text" style="<?php echo esc_attr( $style ); ?>"><?php bloginfo( 'description' ); ?></h2>
 		</div>
 	</div>
 <?php }