Make WordPress Core


Ignore:
Timestamp:
12/02/2016 05:11:56 AM (9 years ago)
Author:
joemcgill
Message:

Twenty Seventeen: Better handling of custom headers when no image is set.

This ensures that a standard header is shown on the front page whenever
a header video is set without a header image if the video doesn't load,
e.g., on mobile sizes or if the JS doesn't fire.

This adds a new class, .has-header-video that is added whenever the
wp-custom-header-video-loaded event is fired, which is then used to style
the custom headers along with .has-header-image whenever a header image
is available. This also changes the class name on the custom header media
wrapping div from .custom-header-image to .custom-header-media.

Props laurelfulford, joemcgill.
Fixes #38995.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentyseventeen/template-parts/header/header-image.php

    r39392 r39413  
    11<?php
    22/**
    3  * Displays header image
     3 * Displays header media
    44 *
    55 * @package WordPress
     
    1212<div class="custom-header">
    1313
    14     <?php if ( has_custom_header() ) : ?>
    15         <div class="custom-header-image">
     14        <div class="custom-header-media">
    1615            <?php the_custom_header_markup(); ?>
    1716        </div>
    18     <?php endif; ?>
    1917
    2018    <?php get_template_part( 'template-parts/header/site', 'branding' ); ?>
Note: See TracChangeset for help on using the changeset viewer.