wp/wp-content/themes/twentythirteen/inc/custom-header.php
author ymh <ymh.work@gmail.com>
Mon, 14 Oct 2019 18:30:03 +0200
changeset 10 372f2766ea20
parent 7 cf61fcea0001
permissions -rw-r--r--
update themes
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     1
<?php
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     2
/**
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     3
 * Implement a custom header for Twenty Thirteen
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     4
 *
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
     5
 * @link https://codex.wordpress.org/Custom_Headers
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     6
 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     7
 * @package WordPress
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     8
 * @subpackage Twenty_Thirteen
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     9
 * @since Twenty Thirteen 1.0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    10
 */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    11
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    12
/**
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    13
 * Set up the WordPress core custom header arguments and settings.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    14
 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    15
 * @uses add_theme_support() to register support for 3.4 and up.
7
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    16
 * @uses twentythirteen_header_style() to style front end.
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    17
 * @uses twentythirteen_admin_header_style() to style wp-admin form.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    18
 * @uses twentythirteen_admin_header_image() to add custom markup to wp-admin form.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    19
 * @uses register_default_headers() to set up the bundled header images.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    20
 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    21
 * @since Twenty Thirteen 1.0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    22
 */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    23
function twentythirteen_custom_header_setup() {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    24
	$args = array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    25
		// Text color and image (empty to use none).
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    26
		'default-text-color'     => '220e10',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    27
		'default-image'          => '%s/images/headers/circle.png',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    28
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    29
		// Set height and width, with a maximum value for the width.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    30
		'height'                 => 230,
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    31
		'width'                  => 1600,
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    32
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    33
		// Callbacks for styling the header and the admin preview.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    34
		'wp-head-callback'       => 'twentythirteen_header_style',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    35
		'admin-head-callback'    => 'twentythirteen_admin_header_style',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    36
		'admin-preview-callback' => 'twentythirteen_admin_header_image',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    37
	);
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    38
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    39
	add_theme_support( 'custom-header', $args );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    40
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    41
	/*
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    42
	 * Default custom headers packaged with the theme.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    43
	 * %s is a placeholder for the theme template directory URI.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    44
	 */
7
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    45
	register_default_headers(
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    46
		array(
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    47
			'circle'  => array(
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    48
				'url'           => '%s/images/headers/circle.png',
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    49
				'thumbnail_url' => '%s/images/headers/circle-thumbnail.png',
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    50
				'description'   => _x( 'Circle', 'header image description', 'twentythirteen' ),
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    51
			),
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    52
			'diamond' => array(
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    53
				'url'           => '%s/images/headers/diamond.png',
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    54
				'thumbnail_url' => '%s/images/headers/diamond-thumbnail.png',
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    55
				'description'   => _x( 'Diamond', 'header image description', 'twentythirteen' ),
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    56
			),
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    57
			'star'    => array(
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    58
				'url'           => '%s/images/headers/star.png',
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    59
				'thumbnail_url' => '%s/images/headers/star-thumbnail.png',
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    60
				'description'   => _x( 'Star', 'header image description', 'twentythirteen' ),
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    61
			),
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    62
		)
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    63
	);
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    64
}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    65
add_action( 'after_setup_theme', 'twentythirteen_custom_header_setup', 11 );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    66
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    67
/**
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    68
 * Load our special font CSS files.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    69
 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    70
 * @since Twenty Thirteen 1.0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    71
 */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    72
function twentythirteen_custom_header_fonts() {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    73
	// Add Source Sans Pro and Bitter fonts.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    74
	wp_enqueue_style( 'twentythirteen-fonts', twentythirteen_fonts_url(), array(), null );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    75
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    76
	// Add Genericons font.
10
372f2766ea20 update themes
ymh <ymh.work@gmail.com>
parents: 7
diff changeset
    77
	wp_enqueue_style( 'genericons', get_template_directory_uri() . '/genericons/genericons.css', array(), '3.0.3' );
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    78
}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    79
add_action( 'admin_print_styles-appearance_page_custom-header', 'twentythirteen_custom_header_fonts' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    80
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    81
/**
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    82
 * Style the header text displayed on the blog.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    83
 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    84
 * get_header_textcolor() options: Hide text (returns 'blank'), or any hex value.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    85
 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    86
 * @since Twenty Thirteen 1.0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    87
 */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    88
function twentythirteen_header_style() {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    89
	$header_image = get_header_image();
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    90
	$text_color   = get_header_textcolor();
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    91
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    92
	// If no custom options for text are set, let's bail.
7
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    93
	if ( empty( $header_image ) && $text_color == get_theme_support( 'custom-header', 'default-text-color' ) ) {
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    94
		return;
7
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    95
	}
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    96
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    97
	// If we get this far, we have custom styles.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    98
	?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    99
	<style type="text/css" id="twentythirteen-header-css">
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   100
	<?php
7
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   101
	if ( ! empty( $header_image ) ) :
10
372f2766ea20 update themes
ymh <ymh.work@gmail.com>
parents: 7
diff changeset
   102
		?>
7
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   103
	.site-header {
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   104
		background: url(<?php header_image(); ?>) no-repeat scroll top;
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   105
		background-size: 1600px auto;
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   106
	}
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   107
	@media (max-width: 767px) {
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   108
		.site-header {
7
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   109
			background-size: 768px auto;
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   110
		}
7
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   111
	}
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   112
	@media (max-width: 359px) {
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   113
		.site-header {
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   114
			background-size: 360px auto;
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   115
		}
7
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   116
	}
10
372f2766ea20 update themes
ymh <ymh.work@gmail.com>
parents: 7
diff changeset
   117
		<?php
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   118
		endif;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   119
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   120
		// Has the text been hidden?
7
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   121
	if ( ! display_header_text() ) :
10
372f2766ea20 update themes
ymh <ymh.work@gmail.com>
parents: 7
diff changeset
   122
		?>
7
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   123
	.site-title,
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   124
	.site-description {
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   125
		position: absolute;
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   126
		clip: rect(1px 1px 1px 1px); /* IE7 */
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   127
		clip: rect(1px, 1px, 1px, 1px);
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   128
	}
10
372f2766ea20 update themes
ymh <ymh.work@gmail.com>
parents: 7
diff changeset
   129
		<?php
372f2766ea20 update themes
ymh <ymh.work@gmail.com>
parents: 7
diff changeset
   130
		if ( empty( $header_image ) ) :
372f2766ea20 update themes
ymh <ymh.work@gmail.com>
parents: 7
diff changeset
   131
			?>
7
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   132
	.site-header .home-link {
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   133
	min-height: 0;
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   134
	}
10
372f2766ea20 update themes
ymh <ymh.work@gmail.com>
parents: 7
diff changeset
   135
			<?php
7
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   136
		endif;
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   137
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   138
		// If the user has set a custom color for the text, use that.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   139
		elseif ( $text_color != get_theme_support( 'custom-header', 'default-text-color' ) ) :
10
372f2766ea20 update themes
ymh <ymh.work@gmail.com>
parents: 7
diff changeset
   140
			?>
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   141
		.site-title,
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   142
		.site-description {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   143
			color: #<?php echo esc_attr( $text_color ); ?>;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   144
		}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   145
	<?php endif; ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   146
	</style>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   147
	<?php
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   148
}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   149
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   150
/**
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   151
 * Style the header image displayed on the Appearance > Header admin panel.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   152
 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   153
 * @since Twenty Thirteen 1.0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   154
 */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   155
function twentythirteen_admin_header_style() {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   156
	$header_image = get_header_image();
10
372f2766ea20 update themes
ymh <ymh.work@gmail.com>
parents: 7
diff changeset
   157
	?>
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   158
	<style type="text/css" id="twentythirteen-admin-header-css">
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   159
	.appearance_page_custom-header #headimg {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   160
		border: none;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   161
		-webkit-box-sizing: border-box;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   162
		-moz-box-sizing:    border-box;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   163
		box-sizing:         border-box;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   164
		<?php
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   165
		if ( ! empty( $header_image ) ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   166
			echo 'background: url(' . esc_url( $header_image ) . ') no-repeat scroll top; background-size: 1600px auto;';
7
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   167
		}
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   168
		?>
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   169
		padding: 0 20px;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   170
	}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   171
	#headimg .home-link {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   172
		-webkit-box-sizing: border-box;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   173
		-moz-box-sizing:    border-box;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   174
		box-sizing:         border-box;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   175
		margin: 0 auto;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   176
		max-width: 1040px;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   177
		<?php
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   178
		if ( ! empty( $header_image ) || display_header_text() ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   179
			echo 'min-height: 230px;';
7
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   180
		}
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   181
		?>
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   182
		width: 100%;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   183
	}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   184
	<?php if ( ! display_header_text() ) : ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   185
	#headimg h1,
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   186
	#headimg h2 {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   187
		position: absolute !important;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   188
		clip: rect(1px 1px 1px 1px); /* IE7 */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   189
		clip: rect(1px, 1px, 1px, 1px);
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   190
	}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   191
	<?php endif; ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   192
	#headimg h1 {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   193
		font: bold 60px/1 Bitter, Georgia, serif;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   194
		margin: 0;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   195
		padding: 58px 0 10px;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   196
	}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   197
	#headimg h1 a {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   198
		text-decoration: none;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   199
	}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   200
	#headimg h1 a:hover {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   201
		text-decoration: underline;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   202
	}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   203
	#headimg h2 {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   204
		font: 200 italic 24px "Source Sans Pro", Helvetica, sans-serif;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   205
		margin: 0;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   206
		text-shadow: none;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   207
	}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   208
	.default-header img {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   209
		max-width: 230px;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   210
		width: auto;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   211
	}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   212
	</style>
10
372f2766ea20 update themes
ymh <ymh.work@gmail.com>
parents: 7
diff changeset
   213
	<?php
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   214
}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   215
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   216
/**
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   217
 * Output markup to be displayed on the Appearance > Header admin panel.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   218
 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   219
 * This callback overrides the default markup displayed there.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   220
 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   221
 * @since Twenty Thirteen 1.0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   222
 */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   223
function twentythirteen_admin_header_image() {
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   224
	$style = 'color: #' . get_header_textcolor() . ';';
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   225
	if ( ! display_header_text() ) {
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   226
		$style = 'display: none;';
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   227
	}
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   228
	?>
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   229
	<div id="headimg" style="background: url(<?php echo esc_url( get_header_image() ); ?>) no-repeat scroll top; background-size: 1600px auto;">
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   230
		<div class="home-link">
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   231
			<h1 class="displaying-header-text"><a id="name" style="<?php echo esc_attr( $style ); ?>" onclick="return false;" href="#" tabindex="-1"><?php bloginfo( 'name' ); ?></a></h1>
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   232
			<h2 id="desc" class="displaying-header-text" style="<?php echo esc_attr( $style ); ?>"><?php bloginfo( 'description' ); ?></h2>
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   233
		</div>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   234
	</div>
10
372f2766ea20 update themes
ymh <ymh.work@gmail.com>
parents: 7
diff changeset
   235
	<?php
7
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   236
}