* * @link https://developer.wordpress.org/themes/functionality/custom-headers/ * * @package Buzzo */ /** * Set up the WordPress core custom header feature. * * @uses buzzo_header_image_style() */ function buzzo_custom_header_setup() { add_theme_support( 'custom-header', apply_filters( 'buzzo_custom_header_args', array( 'default-image' => get_template_directory_uri() . '/images/page-banner.jpg', 'default-text-color' => 'ffffff', 'height' => 400, 'flex-width' => true, 'wp-head-callback' => 'buzzo_header_image_style', ) ) ); } add_action( 'after_setup_theme', 'buzzo_custom_header_setup' ); if ( ! function_exists( 'buzzo_header_image' ) ) { /** * Display header image. */ function buzzo_header_image() { if ( is_singular() ) { return; } get_template_part( 'template-parts/header/header-image' ); } } add_action( 'buzzo_after_header', 'buzzo_header_image' ); if ( ! function_exists( 'buzzo_header_image_style' ) ) : /** * Styles the header image and text displayed on the blog. * * @see buzzo_custom_header_setup(). */ function buzzo_header_image_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 ( HEADER_TEXTCOLOR === $header_text_color ) { return; } // If we get this far, we have custom styles. Let's do this. ?>