WordPress.org

Make WordPress Core

Ticket #25325: 25325.5.diff

File 25325.5.diff, 2.3 KB (added by lancewillett, 8 years ago)

Rework logic to show link or div correctly

  • wp-content/themes/twentyfourteen/header.php

     
    4646
    4747                        <nav role="navigation" class="site-navigation primary-navigation">
    4848                                <h1 class="screen-reader-text"><?php _e( 'Primary Menu', 'twentyfourteen' ); ?></h1>
    49                                 <div class="screen-reader-text skip-link"><a href="#content" title="<?php esc_attr_e( 'Skip to content', 'twentyfourteen' ); ?>"><?php _e( 'Skip to content', 'twentyfourteen' ); ?></a></div>
     49                                <a class="screen-reader-text skip-link" href="#content"><?php _e( 'Skip to content', 'twentyfourteen' ); ?></a></a>
    5050                                <?php wp_nav_menu( array( 'theme_location' => 'primary' ) ); ?>
    5151                        </nav>
    5252                </div>
  • wp-content/themes/twentyfourteen/inc/template-tags.php

     
    145145add_action( 'save_post',     'twentyfourteen_category_transient_flusher' );
    146146
    147147/**
    148  * Displays featured image with appropriate html tag.
     148 * Displays an optional featured image, with an anchor element
     149 * when on index views, and a div element when on a single view.
    149150 *
    150151 * @return void
    151152 */
    152153function twentyfourteen_featured_thumbnail() {
    153         if ( ! post_password_required() ) :
    154                 if ( has_post_thumbnail() && is_singular() ) :
    155                 ?>
    156                         <div class="attachment-featured-thumbnail">
    157                                 <?php the_post_thumbnail( 'featured-thumbnail-large' ); ?>
    158                         </div>
    159                 <?php
    160                 else :
    161                 ?>
    162                         <a href="<?php the_permalink(); ?>" rel="<?php the_ID(); ?>" class="attachment-featured-thumbnail">
    163                                 <?php the_post_thumbnail( 'featured-thumbnail-large' ); ?>
    164                         </a>
    165                 <?php
    166                 endif;
     154        if ( post_password_required() )
     155                return;
     156       
     157        if ( is_singular() ) :
     158        ?>
     159                <div class="attachment-featured-thumbnail">
     160                        <?php the_post_thumbnail( 'featured-thumbnail-large' ); ?>
     161                </div>
     162        <?php
     163        else :
     164        ?>
     165                <a href="<?php the_permalink(); ?>" rel="<?php the_ID(); ?>" class="attachment-featured-thumbnail">
     166                        <?php the_post_thumbnail( 'featured-thumbnail-large' ); ?>
     167                </a>
     168        <?php
    167169        endif;
    168170}
     171 No newline at end of file