Make WordPress Core

Ticket #30432: 30432.diff

File 30432.diff, 5.6 KB (added by philiparthurmoore, 11 years ago)
  • wp-content/themes/twentyfifteen/css/admin-custom-header.css

     
    1 /*
    2 Theme Name: Twenty Fifteen
    3 Description: Used to style the header image displayed on the Appearance > Header screen.
    4 */
    5 
    6 .appearance_page_custom-header #headimg {
    7         background: #fff no-repeat 50% 50%;
    8         background-size: cover;
    9         border: none;
    10         box-sizing: border-box;
    11         padding: 7.6923%;
    12 }
    13 
    14 #headimg h1,
    15 #desc {
    16         color: #333;
    17         font-family: "Noto Sans", sans-serif;
    18 }
    19 
    20 #headimg h1 {
    21         font-size: 22px;
    22         line-height: 1.0909;
    23         margin: 0;
    24 }
    25 
    26 #headimg h1 a {
    27         text-decoration: none;
    28 }
    29 
    30 #desc {
    31         font-size: 12px;
    32         line-height: 1.5;
    33         margin-top: 0.5em;
    34         opacity: 0.7;
    35 }
    36 
    37 /* Hide the header text color option */
    38 .appearance_page_custom-header tr.displaying-header-text,
    39 .appearance_page_custom-header tr.displaying-header-text td,
    40 .appearance_page_custom-header tr.displaying-header-text th {
    41         display: none;
    42 }
    43 
    44 @media screen and (min-width: 772px) {
    45         #headimg h1 {
    46                 font-size: 29px;
    47                 line-height: 1.2069;
    48                 margin: 0;
    49         }
    50 
    51         #desc {
    52                 font-size: 14px;
    53         }
    54 }
    55 
    56 @media screen and (min-width: 783px) {
    57         #headimg h1 {
    58                 font-size: 22px;
    59                 line-height: 1.0909;
    60         }
    61 
    62         #desc {
    63                 font-size: 12px;
    64                 line-height: 1.5;
    65                 margin-top: 0.5em;
    66         }
    67 }
    68 
    69 @media screen and (min-width: 1172px) {
    70         #headimg h1 {
    71                 font-size: 29px;
    72                 line-height: 1.2069;
    73         }
    74 
    75         #desc {
    76                 font-size: 14px;
    77         }
    78 }
    79 
    80 @media screen and (min-width: 1313px) {
    81         #headimg h1 {
    82                 font-size: 32px;
    83                 line-height: 1.25;
    84         }
    85 
    86         #desc {
    87                 font-size: 16px;
    88         }
    89 }
    90 
    91 @media screen and (min-width: 1383px) {
    92         .appearance_page_custom-header #headimg {
    93                 background-position: 100% 50%;
    94                 height: 1300px;
    95                 max-width: 954px;
    96                 padding: 83px 83px 0 0;
    97                 width: 42%;
    98         }
    99 
    100         #headimg h1 {
    101                 float: right;
    102                 font-size: 27px;
    103                 line-height: 1.1852;
    104                 width: 248px;
    105         }
    106 
    107         #desc {
    108                 clear: right;
    109                 float: right;
    110                 width: 248px;
    111         }
    112 }
    113  No newline at end of file
  • wp-content/themes/twentyfifteen/inc/custom-header.php

     
    1111 * Set up the WordPress core custom header feature.
    1212 *
    1313 * @uses twentyfifteen_header_style()
    14  * @uses twentyfifteen_admin_header_image()
    1514 */
    1615function twentyfifteen_custom_header_setup() {
    1716        $color_scheme        = twentyfifteen_get_color_scheme();
     
    3029         *     @type int    $height                 Height in pixels of the custom header image. Default 1300.
    3130         *     @type string $wp-head-callback       Callback function used to styles the header image and text
    3231         *                                          displayed on the blog.
    33          *     @type string $admin-preview-callback Callback function used to create the custom header markup in
    34          *                                          the Appearance > Header screen.
    3532         * }
    3633         */
    3734        add_theme_support( 'custom-header', apply_filters( 'twentyfifteen_custom_header_args', array(
     
    3936                'width'                  => 954,
    4037                'height'                 => 1300,
    4138                'wp-head-callback'       => 'twentyfifteen_header_style',
    42                 'admin-preview-callback' => 'twentyfifteen_admin_header_image',
    4339        ) ) );
    4440}
    4541add_action( 'after_setup_theme', 'twentyfifteen_custom_header_setup' );
     
    130126}
    131127endif; // twentyfifteen_header_style
    132128
    133 if ( ! function_exists( 'twentyfifteen_admin_header_image' ) ) :
    134 /**
    135  * Custom header image markup displayed on the Appearance > Header admin panel.
    136  *
    137  * @since Twenty Fifteen 1.0
    138  * @see twentyfifteen_custom_header_setup().
    139  */
    140 function twentyfifteen_admin_header_image() {
    141         $style                   = sprintf( ' style="color: #%s;"', esc_attr( get_header_textcolor() ) );
    142         $color_scheme            = twentyfifteen_get_color_scheme();
    143         $header_background_color = get_theme_mod( 'header_background_color', $color_scheme[1] );
    144 ?>
    145         <div id="headimg" style="background-image: url(<?php header_image(); ?>); background-color: <?php echo esc_attr( $header_background_color ); ?>;">
    146                 <h1 class="displaying-header-text"><a id="name"<?php echo $style; ?> onclick="return false;" href="<?php echo esc_url( home_url( '/' ) ); ?>" tabindex="-1"><?php bloginfo( 'name' ); ?></a></h1>
    147                 <div id="desc" class="displaying-header-text"<?php echo $style; ?>><?php bloginfo( 'description' ); ?></div>
    148         </div>
    149 <?php
    150 }
    151 endif; // twentyfifteen_admin_header_image
    152 
    153129/**
    154130 * Enqueues front-end CSS for the header background color.
    155131 *
     
    330306
    331307        wp_add_inline_style( 'twentyfifteen-style', sprintf( $css, $sidebar_link_color, $sidebar_text_color, $sidebar_border_color, $sidebar_border_focus_color ) );
    332308}
    333 add_action( 'wp_enqueue_scripts', 'twentyfifteen_sidebar_text_color_css', 11 );
    334 
    335 /**
    336  * Enqueue styles to admin screen for custom header display.
    337  *
    338  * @since Twenty Fifteen 1.0
    339  */
    340 function twentyfifteen_admin_fonts() {
    341         wp_enqueue_style( 'twentyfifteen-fonts', twentyfifteen_fonts_url(), array(), null );
    342         wp_enqueue_style( 'twentyfifteen-custom-header', get_template_directory_uri() . '/css/admin-custom-header.css', array(), '20141010' );
    343 }
    344 add_action( 'admin_print_scripts-appearance_page_custom-header', 'twentyfifteen_admin_fonts' );
     309add_action( 'wp_enqueue_scripts', 'twentyfifteen_sidebar_text_color_css', 11 );
     310 No newline at end of file