twentythirteen_header_style

Style the header text displayed on the blog.

Description

twentythirteen_header_style(); 

get_header_textcolor() options: Hide text (returns blank), or any hex value.


Usage

  1. if ( !function_exists( 'twentythirteen_header_style' ) ) { 
  2. require_once '/inc/custom-header.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = twentythirteen_header_style(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/inc/custom-header.php  
  1. function twentythirteen_header_style() { 
  2. $header_image = get_header_image(); 
  3. $text_color = get_header_textcolor(); 
  4.  
  5. // If no custom options for text are set, let's bail. 
  6. if ( empty( $header_image ) && $text_color == get_theme_support( 'custom-header', 'default-text-color' ) ) 
  7. return; 
  8.  
  9. // If we get this far, we have custom styles. 
  10. ?> 
  11. <style type="text/css" id="twentythirteen-header-css"> 
  12. <?php 
  13. if ( ! empty( $header_image ) ) : 
  14. ?> 
  15. .site-header { 
  16. background: url(<?php header_image(); ?>) no-repeat scroll top; 
  17. background-size: 1600px auto; 
  18. @media (max-width: 767px) { 
  19. .site-header { 
  20. background-size: 768px auto; 
  21. @media (max-width: 359px) { 
  22. .site-header { 
  23. background-size: 360px auto; 
  24. <?php 
  25. endif; 
  26.  
  27. // Has the text been hidden? 
  28. if ( ! display_header_text() ) : 
  29. ?> 
  30. .site-title,  
  31. .site-description { 
  32. position: absolute; 
  33. clip: rect(1px 1px 1px 1px); /* IE7 */ 
  34. clip: rect(1px, 1px, 1px, 1px); 
  35. <?php 
  36. if ( empty( $header_image ) ) : 
  37. ?> 
  38. .site-header .home-link { 
  39. min-height: 0; 
  40. <?php 
  41. endif; 
  42.  
  43. // If the user has set a custom color for the text, use that. 
  44. elseif ( $text_color != get_theme_support( 'custom-header', 'default-text-color' ) ) : 
  45. ?> 
  46. .site-title,  
  47. .site-description { 
  48. color: #<?php echo esc_attr( $text_color ); ?>; 
  49. <?php endif; ?> 
  50. </style> 
  51. <?php