24
24
* @param array $args {
25
25
* An array of custom-header support arguments.
27
* @type string $default-image Default image of the header.
28
* @type string $default_text_color Default color of the header text.
27
* @type string $default-image Default image of the header.
29
28
* @type int $width Width in pixels of the custom header image. Default 954.
30
29
* @type int $height Height in pixels of the custom header image. Default 1300.
30
* @type string $flex-height Flex support for height of header.
31
* @type string $video Video support for header.
31
32
* @type string $wp-head-callback Callback function used to styles the header image and text
32
33
* displayed on the blog.
33
* @type string $flex-height Flex support for height of header.
36
add_theme_support( 'custom-header', apply_filters( 'twentyseventeen_custom_header_args', array(
37
'default-image' => get_parent_theme_file_uri( '/assets/images/header.jpg' ),
40
'flex-height' => true,
42
'wp-head-callback' => 'twentyseventeen_header_style',
39
'twentyseventeen_custom_header_args',
41
'default-image' => get_parent_theme_file_uri( '/assets/images/header.jpg' ),
44
'flex-height' => true,
46
'wp-head-callback' => 'twentyseventeen_header_style',
45
register_default_headers( array(
46
'default-image' => array(
47
'url' => '%s/assets/images/header.jpg',
48
'thumbnail_url' => '%s/assets/images/header.jpg',
49
'description' => __( 'Default Header Image', 'twentyseventeen' ),
51
register_default_headers(
53
'default-image' => array(
54
'url' => '%s/assets/images/header.jpg',
55
'thumbnail_url' => '%s/assets/images/header.jpg',
56
'description' => __( 'Default Header Image', 'twentyseventeen' ),
53
61
add_action( 'after_setup_theme', 'twentyseventeen_custom_header_setup' );
55
63
if ( ! function_exists( 'twentyseventeen_header_style' ) ) :
57
* Styles the header image and text displayed on the blog.
59
* @see twentyseventeen_custom_header_setup().
61
function twentyseventeen_header_style() {
62
$header_text_color = get_header_textcolor();
64
// If no custom options for text are set, let's bail.
65
// get_header_textcolor() options: add_theme_support( 'custom-header' ) is default, hide text (returns 'blank') or any hex value.
66
if ( get_theme_support( 'custom-header', 'default-text-color' ) === $header_text_color ) {
70
// If we get this far, we have custom styles. Let's do this.
72
<style id="twentyseventeen-custom-header-styles" type="text/css">
65
* Styles the header image and text displayed on the blog.
67
* @see twentyseventeen_custom_header_setup().
69
function twentyseventeen_header_style() {
70
$header_text_color = get_header_textcolor();
72
// If no custom options for text are set, let's bail.
73
// get_header_textcolor() options: add_theme_support( 'custom-header' ) is default, hide text (returns 'blank') or any hex value.
74
if ( get_theme_support( 'custom-header', 'default-text-color' ) === $header_text_color ) {
78
// If we get this far, we have custom styles. Let's do this.
80
<style id="twentyseventeen-custom-header-styles" type="text/css">
74
82
// Has the text been hidden?
75
83
if ( 'blank' === $header_text_color ) :
78
86
.site-description {
79
87
position: absolute;
80
88
clip: rect(1px, 1px, 1px, 1px);
83
// If the user has set a custom color for the text use that.
91
// If the user has set a custom color for the text use that.
87
95
.colors-dark .site-title a,
88
96
.colors-custom .site-title a,