WordPress.org

Make WordPress Core

Changeset 17775


Ignore:
Timestamp:
04/29/2011 10:22:19 PM (10 years ago)
Author:
lancewillett
Message:

Twenty Eleven: improve calls to get_header_image() - see #17240 and #17198

Location:
trunk/wp-content/themes/twentyeleven
Files:
2 edited

Legend:

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

    r17761 r17775  
    287287        <h1><a id="name"<?php echo $style; ?> onclick="return false;" href="<?php echo home_url( '/' ); ?>"><?php bloginfo( 'name' ); ?></a></h1>
    288288        <div id="desc"<?php echo $style; ?>><?php bloginfo( 'description' ); ?></div>
    289         <img src="<?php esc_url ( header_image() ); ?>" alt="" />
     289        <?php $header_image = get_header_image();
     290        if ( ! empty( $header_image ) ) : ?>
     291            <img src="<?php esc_url( $header_image ); ?>" alt="" />
     292        <?php endif; ?>
    290293    </div>
    291294<?php }
  • trunk/wp-content/themes/twentyeleven/header.php

    r17718 r17775  
    6262            <?php
    6363                // Check to see if the header image has been removed
    64                 if ( get_header_image() != '' ) :
     64                $header_image = get_header_image();
     65                if ( ! empty( $header_image ) ) :
    6566            ?>
    6667            <a href="<?php echo home_url( '/' ); ?>">
     
    8485                if ( 'blank' == get_header_textcolor() ) :
    8586            ?>
    86                 <div class="only-search<?php if ( get_header_image() != '' ) : ?> with-image<?php endif; ?>">
     87                <div class="only-search<?php if ( ! empty( $header_image ) ) : ?> with-image<?php endif; ?>">
    8788                <?php get_search_form(); ?>
    8889                </div>
Note: See TracChangeset for help on using the changeset viewer.