Make WordPress Core

Changeset 36913


Ignore:
Timestamp:
03/09/2016 11:01:53 PM (11 years ago)
Author:
karmatosed
Message:

Twenty Fifteen: add support for site logos
Fixes #35944
Props @iamtakashi, @celloexpressions, @drebbits.web

Location:
trunk/src/wp-content/themes/twentyfifteen
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentyfifteen/functions.php

    r32843 r36913  
    103103                'aside', 'image', 'video', 'quote', 'link', 'gallery', 'status', 'audio', 'chat'
    104104        ) );
     105
     106        /*
     107         * Enable support for custom logo.
     108         *
     109         * @since Twenty Fifteen 1.5
     110         */
     111        add_image_size( 'twentyfifteen-logo', 248, 248 );
     112        add_theme_support( 'custom-logo', array( 'size' => 'twentyfifteen-logo' ) );
    105113
    106114        $color_scheme  = twentyfifteen_get_color_scheme();
  • trunk/src/wp-content/themes/twentyfifteen/header.php

    r31184 r36913  
    3030                        <div class="site-branding">
    3131                                <?php
     32                                        twentyfifteen_the_custom_logo();
     33
    3234                                        if ( is_front_page() && is_home() ) : ?>
    3335                                                <h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
  • trunk/src/wp-content/themes/twentyfifteen/inc/template-tags.php

    r33005 r36913  
    242242add_filter( 'excerpt_more', 'twentyfifteen_excerpt_more' );
    243243endif;
     244
     245if ( ! function_exists( 'twentyfifteen_the_custom_logo' ) ) :
     246/**
     247 * Displays the optional custom logo.
     248 *
     249 * Returns early if the custom logo is not available.
     250 *
     251 * @since Twenty Fifteen 1.5
     252 */
     253function twentyfifteen_the_custom_logo() {
     254        if ( ! function_exists( 'the_custom_logo' ) ) {
     255                return;
     256        } else {
     257                the_custom_logo();
     258        }
     259}
     260endif;
  • trunk/src/wp-content/themes/twentyfifteen/style.css

    r36875 r36913  
    13171317}
    13181318
     1319.custom-logo {
     1320        max-height: 84px;
     1321        width: auto;
     1322}
     1323
     1324.wp-custom-logo .site-title {
     1325        margin-top: 0.545454545em;
     1326}
     1327
    13191328.site-description {
    13201329        display: none;
     
    30903099        }
    30913100
     3101        .custom-logo {
     3102                max-height: 105px;
     3103        }
     3104
     3105        .wp-custom-logo .site-title {
     3106                margin-top: 0.482758621em;
     3107        }
     3108
    30923109        .site-description {
    30933110                font-size: 14px;
     
    37123729        }
    37133730
     3731        .custom-logo {
     3732                max-height: 104px;
     3733        }
     3734
     3735        .wp-custom-logo .site-title {
     3736                margin-top: 0.5em;
     3737        }
     3738
    37143739        .site-description {
    37153740                font-size: 16px;
     
    43474372        }
    43484373
     4374        .custom-logo {
     4375                max-height: none;
     4376        }
     4377
     4378        .wp-custom-logo .site-title {
     4379                margin-top: 0.545454545em;
     4380        }
     4381
    43494382        .site-description {
    43504383                font-size: 12px;
     
    49664999        }
    49675000
     5001        .wp-custom-logo .site-title {
     5002                margin-top: 0.583333333em;
     5003        }
     5004
    49685005        .site-description {
    49695006                font-size: 14px;
     
    55045541        }
    55055542
     5543        .wp-custom-logo .site-title {
     5544                margin-top: 0.592592593em;
     5545        }
     5546
    55065547        .site-description {
    55075548                font-size: 16px;
Note: See TracChangeset for help on using the changeset viewer.