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