* * @link https://developer.wordpress.org/themes/functionality/custom-headers/ * * @package Hotelflix */ /** * Set up the WordPress core custom header feature. * * @uses hotelflix_header_style() */ function hotelflix_custom_header_setup() { add_theme_support( 'custom-header', apply_filters( 'hotelflix_custom_header_args', array( 'default-image' => get_template_directory_uri() . '/images/404.png', 'default-text-color' => '131935', 'width' => 2000, 'height' => 400, 'flex-height' => true, 'wp-head-callback' => 'hotelflix_header_style', ) ) ); register_default_headers( array( 'tablet' => array( 'url' => '%s/images/header.jpg', 'thumbnail_url' => '%s/images/header.jpg', 'description' => __( 'Tablet', 'hotelflix' ), ), 'building' => array( 'url' => '%s/images/header2.jpg', 'thumbnail_url' => '%s/images/header2.jpg', 'description' => __( 'Building', 'hotelflix' ), ), 'room' => array( 'url' => '%s/images/404.png', 'thumbnail_url' => '%s/images/404.png', 'description' => __( 'Hotel room', 'hotelflix' ), ), ) ); } add_action( 'after_setup_theme', 'hotelflix_custom_header_setup' ); if ( ! function_exists( 'hotelflix_header_style' ) ) : /** * Styles the header image and text displayed on the blog. * * @see hotelflix_custom_header_setup(). */ function hotelflix_header_style() { $header_text_color = get_header_textcolor(); $header_image = get_header_image(); // If we get this far, we have custom styles. Let's do this. ?>