Make WordPress Core

Ticket #25031: 25031.5.diff

File 25031.5.diff, 10.5 KB (added by obenland, 13 years ago)
  • wp-content/themes/twentyfourteen/functions.php

     
    5757        add_theme_support( 'post-thumbnails', array( 'post' ) );
    5858
    5959        // Adding several sizes for Post Thumbnails.
    60         add_image_size( 'featured-thumbnail-large', 672, 0 );
     60        add_image_size( 'featured-thumbnail-large', 1010, 0 );
    6161        add_image_size( 'featured-thumbnail-featured', 672, 336, true );
    6262        add_image_size( 'featured-thumbnail-formatted', 306, 0 );
    6363
     
    9999 * @return void
    100100 */
    101101function twentyfourteen_content_width() {
    102         if ( is_page_template( 'full-width-page.php' ) || is_attachment() )
     102        if ( ( ! is_front_page() && ! is_active_sidebar( 'sidebar-3' ) ) || is_page_template( 'full-width-page.php' ) || is_attachment() )
    103103                $GLOBALS['content_width'] = 895;
    104104}
    105105add_action( 'template_redirect', 'twentyfourteen_content_width' );
     
    122122
    123123                $featured_posts = apply_filters( 'twentyfourteen_get_featured_posts', array() );
    124124
    125         return is_array( $featured_posts ) && count( $featured_posts ) > absint( $minimum );
     125        return is_array( $featured_posts ) && count( $featured_posts ) >= absint( $minimum );
    126126}
    127127
    128128/**
     
    410410 * @return array The filtered body class list.
    411411 */
    412412function twentyfourteen_body_classes( $classes ) {
    413         // Adds a class of group-blog to blogs with more than 1 published author
    414         if ( is_multi_author() ) {
     413        // Adds a class of group-blog to blogs with more than 1 published author.
     414        if ( is_multi_author() )
    415415                $classes[] = 'group-blog';
    416         }
    417         if ( is_archive() || is_search() || is_home() ) {
     416
     417        if ( is_archive() || is_search() || is_home() )
    418418                $classes[] = 'list-view';
    419         }
     419
     420        if ( ( ! is_front_page() && ! is_active_sidebar( 'sidebar-3' ) ) || is_page_template( 'full-width-page.php' ) )
     421                $classes[] = 'full-width';
    420422
    421423        return $classes;
    422424}
  • wp-content/themes/twentyfourteen/featured-content.php

     
    99 */
    1010?>
    1111
    12 <div class="featured-content-wrapper">
    13         <div id="featured-content" class="featured-content">
    1412
    15                 <?php
    16                         do_action( 'twentyfourteen_featured_posts_before' );
     13<div id="featured-content" class="featured-content">
    1714
    18                         $featured_posts = twentyfourteen_get_featured_posts();
    19                         foreach ( (array) $featured_posts as $order => $post ) :
    20                                 setup_postdata( $post );
     15        <?php
     16                do_action( 'twentyfourteen_featured_posts_before' );
    2117
    22                                 get_template_part( 'content', 'featured-post' );
    23                         endforeach;
     18                $featured_posts = twentyfourteen_get_featured_posts();
     19                foreach ( (array) $featured_posts as $order => $post ) :
     20                        setup_postdata( $post );
    2421
    25                         do_action( 'twentyfourteen_featured_posts_after' );
     22                        get_template_part( 'content', 'featured-post' );
     23                endforeach;
    2624
    27                         wp_reset_postdata();
    28                 ?>
     25                do_action( 'twentyfourteen_featured_posts_after' );
    2926
    30         </div><!-- .featured-content -->
    31 </div><!-- .featured-content-wrapper -->
     27                wp_reset_postdata();
     28        ?>
     29
     30</div><!-- .featured-content -->
  • wp-content/themes/twentyfourteen/front-page.php

     
    66 * @subpackage Twenty_Fourteen
    77 */
    88
    9 get_header(); ?>
    10 
    11         <div class="front-page-content-wrapper">
    12                 <div class="front-page-content-main">
    13 
    14                         <?php if ( twentyfourteen_has_featured_posts() ) : ?>
    15                                 <?php get_template_part( 'featured-content' ); ?>
    16                         <?php endif; ?>
    17 
    18                         <div class="front-page-content-area">
     9get_header();
    1910
    20                                 <div id="primary" class="content-area no-sidebar">
    21                                         <div id="content" class="site-content" role="main">
    22                                         <?php
    23                                                 if ( have_posts() ) :
    24                                                         while ( have_posts() ) :
    25                                                                 the_post();
     11if ( twentyfourteen_has_featured_posts() )
     12        get_template_part( 'featured-content' );
    2613
    27                                                                 get_template_part( 'content', get_post_format() );
     14?>
    2815
    29                                                                 comments_template();
    30                                                         endwhile;
    31                                                         twentyfourteen_paging_nav();
     16<div id="primary" class="content-area">
     17        <div id="content" class="site-content" role="main">
     18                <?php
     19                        if ( have_posts() ) :
     20                                while ( have_posts() ) :
     21                                        the_post();
    3222
    33                                                 else :
    34                                                         get_template_part( 'no-results', 'index' );
     23                                        get_template_part( 'content', get_post_format() );
    3524
    36                                                 endif;
    37                                         ?>
    38                                         </div><!-- #content .site-content -->
    39                                 </div><!-- #primary .content-area -->
     25                                        comments_template();
     26                                endwhile;
     27                                twentyfourteen_paging_nav();
    4028
    41                                 <?php get_sidebar( 'ephemera' ); ?>
     29                        else :
     30                                get_template_part( 'no-results', 'index' );
    4231
    43                         </div><!-- .front-page-content-area -->
    44 
    45                 </div><!-- .front-page-content-main -->
    46         </div><!-- .front-page-content-wrapper -->
     32                        endif;
     33                ?>
     34        </div><!-- #content -->
     35</div><!-- #primary -->
    4736
    4837<?php
     38get_sidebar( 'ephemera' );
    4939get_sidebar();
    5040get_footer();
  • wp-content/themes/twentyfourteen/image.php

     
    66 * @subpackage Twenty_Fourteen
    77 */
    88
     9$metadata = wp_get_attachment_metadata();
     10
    911get_header();
    1012?>
    1113
    1214<section id="primary" class="content-area image-attachment">
    13         <div id="content" class="site-content full-width" role="main">
     15        <div id="content" class="site-content" role="main">
    1416
    1517        <?php while ( have_posts() ) : the_post(); ?>
    1618
     
    1921                                <?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
    2022
    2123                                <div class="entry-meta">
    22                                         <?php $metadata = wp_get_attachment_metadata(); ?>
    23 
    2424                                        <span class="entry-date"><time class="entry-date" datetime="<?php echo esc_attr( get_the_date( 'c' ) ); ?>"><?php echo esc_html( get_the_date() ); ?></time></span>
    2525
    2626                                        <span class="full-size-link"><a href="<?php echo wp_get_attachment_url(); ?>" title="Link to full-size image"><?php echo $metadata['width']; ?> &times; <?php echo $metadata['height']; ?></a></span>
  • wp-content/themes/twentyfourteen/style.css

     
    528528.site-main {
    529529        max-width: 1230px;
    530530        max-width: 123.0rem;
     531        position: relative
    531532}
    532533.content-area {
    533534        padding-top:24px;
     
    964965        max-width: 672px;
    965966        max-width: 67.2rem;
    966967}
     968.full-width .hentry {
     969        max-width: inherit;
     970}
    967971.attachment-featured-thumbnail {
    968972        background: #767676 url(images/pattern.png) repeat 0 0;
    969973        background-size: 5px 5px;
     
    14871491}
    14881492.ephemera .hentry {
    14891493        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
     1494        border-top: 0;
    14901495        margin-bottom: 18px;
    14911496        margin-bottom: 1.8rem;
    14921497}
     
    25052510                float: left;
    25062511                padding: 36px 0;
    25072512                padding: 3.6rem 0;
     2513                position: relative;
    25082514                width: 100%;
    25092515        }
    25102516        .site-content {
    25112517                margin: 0 33.33333333% 0 0;
    25122518        }
    2513         .content-sidebar {
    2514                 float: right;
    2515                 margin: 0 0 0 -30.35714285%;
    2516                 padding: 36px 10px 24px 0;
    2517                 padding: 3.6rem 1.0rem 2.4rem 0;
    2518                 width: 30.35714285%;
     2519        .full-width .site-content {
     2520                margin: 0;
    25192521        }
     2522        .content-sidebar,
    25202523        .ephemera {
    25212524                border: none;
    2522                 clear: none;
    2523                 float: right;
    2524                 margin: 0 0 0 -30.35714285%;
    2525                 padding: 36px 10px 0 0;
    2526                 padding: 3.6rem 1.0rem 0 0;
     2525                padding: 36px 10px 24px 0;
     2526                padding: 3.6rem 1rem 2.4rem 0;
     2527                position: absolute;
     2528                        right: 0;
     2529                        top: 0;
    25272530                width: 30.35714285%;
    25282531        }
    25292532        #featured-content .hentry {
     
    27982801        #secondary {
    27992802                background-color: transparent;
    28002803                border-bottom: 0;
    2801                 clear: none;
    28022804                font-size: 1.1rem;
    2803                 float: left;
    28042805                line-height: 1.6363636363;
    2805                 margin: 0 0 0 -100%;
    28062806                padding: 0 27px;
    28072807                padding: 0 2.7rem;
     2808                position: absolute;
     2809                        top: 0;
    28082810                width: 168px;
    28092811                width: 16.8rem;
    28102812        }
     
    28212823                margin: 0 27.31707317% 0 222px;
    28222824                margin: 0 27.31707317% 0 22.2rem;
    28232825        }
     2826        .full-width .site-content {
     2827                margin: 0 0 0 222px;
     2828                margin: 0 0 0 22.2rem;
     2829        }
    28242830        .content-sidebar,
    28252831        .ephemera {
    2826                 margin: 0 0 0 -27.31707317%;
    28272832                width: 24.87804878%;
    28282833        }
    28292834        .content-area .entry-header,
     
    30533058                max-width: 1260px;
    30543059                max-width: 126.0rem;
    30553060        }
    3056         .content-sidebar,
    3057         .ephemera {
    3058                 padding-right: 0;
    3059         }
    30603061        .content-area .full-width .entry-header,
    30613062        .content-area .full-width .entry-content,
    30623063        .content-area .full-width .page-content,
  • wp-content/themes/twentyfourteen/full-width-page.php

     
    99get_header(); ?>
    1010
    1111        <div id="primary" class="content-area">
    12                 <div id="content" class="site-content full-width" role="main">
     12                <div id="content" class="site-content" role="main">
    1313                        <?php
    1414                                while ( have_posts() ) :
    1515                                        the_post();
  • wp-content/themes/twentyfourteen/sidebar-content.php

     
    55 * @package WordPress
    66 * @subpackage Twenty_Fourteen
    77 */
    8 ?>
    9 <div id="content-sidebar" class="content-sidebar widget-area" role="complementary">
    10         <?php do_action( 'before_sidebar' ); ?>
    118
    12         <?php if ( ! dynamic_sidebar( 'sidebar-3' ) ) : ?>
    13                 <aside id="search" class="widget widget_search">
    14                                 <?php get_search_form(); ?>
    15                 </aside>
    16 
    17                 <aside id="link" class="widget widget_links">
    18                         <h1 class="widget-title"><?php _e( 'Blogroll', 'twentyfourteen' ); ?></h1>
    19                         <ul class="xoxo blogroll">
    20                                 <?php wp_list_bookmarks( array( 'title_li' => '', 'categorize' => 0 ) ); ?>
    21                         </ul>
    22                 </aside>
     9if ( ! is_active_sidebar( 'sidebar-3' ) )
     10        return;
     11?>
    2312
    24                 <aside id="meta" class="widget">
    25                         <h1 class="widget-title"><?php _e( 'Meta', 'twentyfourteen' ); ?></h1>
    26                         <ul>
    27                                 <?php wp_register(); ?>
    28                                 <li><?php wp_loginout(); ?></li>
    29                                 <?php wp_meta(); ?>
    30                         </ul>
    31                 </aside>
    32         <?php endif; // end sidebar widget area ?>
     13<div id="content-sidebar" class="content-sidebar widget-area" role="complementary">
     14        <?php dynamic_sidebar( 'sidebar-3' ); ?>
    3315</div><!-- #content-sidebar -->