Make WordPress Core


Ignore:
Timestamp:
09/20/2013 06:21:30 PM (13 years ago)
Author:
lancewillett
Message:

Twenty Fourteen: first pass at improving responsive patterns and allowing for a full-width layout when no secondary sidebar is present. Props iamtakashi, see #25332.

File:
1 edited

Legend:

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

    r25510 r25519  
    100100
    101101/**
    102  * Adjusts content_width value for full width and attachment templates.
     102 * Adjusts content_width value for full-width and attachment templates.
    103103 *
    104104 * @return void
    … …  
    106106function twentyfourteen_content_width() {
    107107        if ( is_page_template( 'full-width-page.php' ) || is_attachment() )
    108                 $GLOBALS['content_width'] = 895;
     108                $GLOBALS['content_width'] = 810;
    109109}
    110110add_action( 'template_redirect', 'twentyfourteen_content_width' );
    … …  
    362362        ?>
    363363
    364         <div class="contributor clear">
    365                 <div class="contributor-avatar"><?php echo get_avatar( $contributor_id, 132 ); ?></div>
    366                 <div class="contributor-summary">
    367                         <h2 class="contributor-name"><?php echo get_the_author_meta( 'display_name', $contributor_id ); ?></h2>
    368                         <p class="contributor-bio">
    369                                 <?php echo get_the_author_meta( 'description', $contributor_id ); ?>
    370                         </p>
    371                         <a class="contributor-posts-link" href="<?php echo esc_url( get_author_posts_url( $contributor_id ) ); ?>">
    372                                 <?php printf( _n( '%d Article', '%d Articles', $post_count, 'twentyfourteen' ), $post_count ); ?>
    373                         </a>
    374                 </div>
     364        <div class="contributor">
     365                <div class="contributor-info clear">
     366                        <div class="contributor-avatar"><?php echo get_avatar( $contributor_id, 132 ); ?></div>
     367                        <div class="contributor-summary">
     368                                <h2 class="contributor-name"><?php echo get_the_author_meta( 'display_name', $contributor_id ); ?></h2>
     369                                <p class="contributor-bio">
     370                                        <?php echo get_the_author_meta( 'description', $contributor_id ); ?>
     371                                </p>
     372                                <a class="contributor-posts-link" href="<?php echo esc_url( get_author_posts_url( $contributor_id ) ); ?>">
     373                                        <?php printf( _n( '%d Article', '%d Articles', $post_count, 'twentyfourteen' ), $post_count ); ?>
     374                                </a>
     375                        </div><!-- .contributor-summary -->
     376                </div><!-- .contributor-info -->
    375377        </div><!-- .contributor -->
    376378
    … …  
    457459 * 1. Single or multiple authors.
    458460 * 2. Index views.
     461 * 3. Full-width content layout.
    459462 *
    460463 * @param array $classes A list of existing body class values.
    … …  
    462465 */
    463466function twentyfourteen_body_classes( $classes ) {
    464         // Adds a class of group-blog to blogs with more than 1 published author
    465         if ( is_multi_author() ) {
     467        if ( is_multi_author() )
    466468                $classes[] = 'group-blog';
    467         }
    468         if ( is_archive() || is_search() || is_home() ) {
     469
     470        if ( is_archive() || is_search() || is_home() )
    469471                $classes[] = 'list-view';
    470         }
     472
     473        if ( is_page_template( 'full-width-page.php' ) || is_page_template( 'contributor-page.php' ) || is_attachment() )
     474                $classes[] = 'full-width';
    471475
    472476        return $classes;
Note: See TracChangeset for help on using the changeset viewer.