*
* @link https://developer.wordpress.org/themes/functionality/custom-headers/
*
* @package The_M.X.
*/
/**
* Set up the WordPress core custom header feature.
*
* @uses the_mx_header_style()
*/
function the_mx_custom_header_setup() {
$color_scheme = the_mx_get_color_scheme();
$default_text_color = trim( $color_scheme[8], '#' );
add_theme_support( 'custom-header', apply_filters( 'the_mx_custom_header_args', array(
'default-image' => '',
'default-text-color' => $default_text_color,
'width' => 1920,
'height' => 540,
'flex-height' => true,
'wp-head-callback' => 'the_mx_header_style',
) ) );
}
add_action( 'after_setup_theme', 'the_mx_custom_header_setup' );
if ( ! function_exists( 'the_mx_header_style' ) ) :
/**
* Styles the header image and text displayed on the blog.
*
* @see the_mx_custom_header_setup().
*/
function the_mx_header_style() {
$header_text_color = get_header_textcolor();
/*
* If no custom options for text are set, let's bail.
* get_header_textcolor() options: Any hex value, 'blank' to hide text. Default: HEADER_TEXTCOLOR.
*/
// If we get this far, we have custom styles. Let's do this.
?>