catchresponsive_custom_header

Implementation of the Custom Header feature Setup the WordPress core custom header feature and default custom headers packaged with the theme.

Description

catchresponsive_custom_header(); 

Note that this function is hooked into the after_setup_theme hook, which runs before the init hook. The init hook is too late for some features, such as indicating support post thumbnails.


Usage

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

Defined (1)

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

/inc/catchresponsive-custom-header.php  
  1. function catchresponsive_custom_header() { 
  2.  
  3.  
  4. if ( 'light' == $options['color_scheme'] ) { 
  5. $default_header_color = catchresponsive_get_default_theme_options(); 
  6. $default_header_color = $default_header_color['header_textcolor']; 
  7. elseif ( 'dark' == $options['color_scheme'] ) { 
  8. $default_header_color = catchresponsive_default_dark_color_options(); 
  9. $default_header_color = $default_header_color['header_textcolor']; 
  10.  
  11. $args = array( 
  12. // Text color and image (empty to use none). 
  13. 'default-text-color' => $default_header_color,  
  14.  
  15. // Header image default 
  16. 'default-image' => get_template_directory_uri() . '/images/headers/buddha.jpg',  
  17.  
  18. // Set height and width, with a maximum value for the width. 
  19. 'height' => 400,  
  20. 'width' => 1200,  
  21.  
  22. // Support flexible height and width. 
  23. 'flex-height' => true,  
  24. 'flex-width' => true,  
  25.  
  26. // Random image rotation off by default. 
  27. 'random-default' => false,  
  28.  
  29. // Callbacks for styling the header and the admin preview. 
  30. 'wp-head-callback' => 'catchresponsive_header_style',  
  31. 'admin-head-callback' => 'catchresponsive_admin_header_style',  
  32. 'admin-preview-callback' => 'catchresponsive_admin_header_image',  
  33. ); 
  34.  
  35. $args = apply_filters( 'custom-header', $args ); 
  36.  
  37. // Add support for custom header 
  38. add_theme_support( 'custom-header', $args ); 
  39.