'ffffff', 'default-image' => get_theme_file_uri('/framework/assets/images/header-image.jpg'), /* ==================================================================================================================== Enable and activate the height and width fo the image for the custom header ==================================================================================================================== */ 'height' => 1200, 'max-width' => 2000, 'width' => 2000, /* ==================================================================================================================== Enable and activate support for flexible height and width ==================================================================================================================== */ 'flex-height' => false, 'flex-width' => false, /* ==================================================================================================================== Enable and activate the callback for the custom header. ==================================================================================================================== */ 'wp-head-callback' => 'camaraderie_custom_header_styles_setup', ); add_theme_support('custom-header', $args); /* ======================================================================================================================== Enable and activate the default headers for the custom header. This is needed so that by default the image will show, if not, it will not. ======================================================================================================================== */ register_default_headers(array( 'header-image' => array( 'url' => '%s/framework/assets/images/header-image.jpg', 'thumbnail_url' => '%s/framework/assets/images/header-image.jpg', 'description' => esc_html__('Header Image', 'camaraderie') ))); } add_action('after_setup_theme', 'camaraderie_custom_header_setup'); /* ============================================================================================================================ 2.0 - Custom Header (CSS) ============================================================================================================================ */ function camaraderie_custom_header_styles_setup() { $text_color = get_header_textcolor(); if ($text_color == get_theme_support('custom-header', 'default-text-color')) { return; } $value = display_header_text() ? sprintf('color: #%s', esc_html($text_color)) : 'display: none;'; $custom_css = " .site-title a, .site-description { {$value} } "; wp_add_inline_style('camaraderie-style', $custom_css); } add_action('wp_enqueue_scripts', 'camaraderie_custom_header_styles_setup');