WordPress.org

Make WordPress Core

Changeset 25985


Ignore:
Timestamp:
10/29/2013 07:05:02 PM (7 years ago)
Author:
lancewillett
Message:

Twenty Fourteen: allow any page to be set as the front page, removing requirement for front-page.php template file. Props iamtakashi, fixes #25685.

Location:
trunk/src/wp-content/themes/twentyfourteen
Files:
1 deleted
13 edited

Legend:

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

    r25769 r25985  
    1010get_header(); ?>
    1111
     12<div id="main-content" class="main-content">
    1213    <div id="primary" class="content-area">
    1314        <div id="content" class="site-content" role="main">
     
    2526        </div><!-- #content -->
    2627    </div><!-- #primary -->
     28    <?php get_sidebar( 'content' ); ?>
     29</div><!-- #main-content -->
    2730
    2831<?php
    29 get_sidebar( 'content' );
    3032get_sidebar();
    3133get_footer();
  • trunk/src/wp-content/themes/twentyfourteen/archive.php

    r25769 r25985  
    2020get_header(); ?>
    2121
     22<div id="main-content" class="main-content">
    2223    <section id="primary" class="content-area">
    2324        <div id="content" class="site-content" role="main">
     
    6061        </div><!-- #content -->
    6162    </section><!-- #primary -->
     63    <?php get_sidebar( 'content' ); ?>
     64</div><!-- #main-content -->
    6265
    6366<?php
    64 get_sidebar( 'content' );
    6567get_sidebar();
    6668get_footer();
  • trunk/src/wp-content/themes/twentyfourteen/category.php

    r25769 r25985  
    1212get_header(); ?>
    1313
     14<div id="main-content" class="main-content">
    1415    <section id="primary" class="content-area">
    1516        <div id="content" class="site-content" role="main">
     
    4445        </div><!-- #content -->
    4546    </section><!-- #primary -->
     47    <?php get_sidebar( 'content' ); ?>
     48</div><!-- #main-content -->
    4649
    4750<?php
    48 get_sidebar( 'content' );
    4951get_sidebar();
    5052get_footer();
  • trunk/src/wp-content/themes/twentyfourteen/contributor-page.php

    r25769 r25985  
    99
    1010get_header(); ?>
     11
     12<div id="main-content" class="main-content">
     13
     14<?php
     15    if ( is_front_page() && twentyfourteen_has_featured_posts() )
     16        get_template_part( 'featured-content' );
     17?>
    1118
    1219    <div id="primary" class="content-area">
     
    3542        </div><!-- #content -->
    3643    </div><!-- #primary -->
     44</div><!-- #main-content -->
    3745
    3846<?php
  • trunk/src/wp-content/themes/twentyfourteen/full-width-page.php

    r25769 r25985  
    99
    1010get_header(); ?>
     11
     12<div id="main-content" class="main-content">
     13
     14<?php
     15    if ( is_front_page() && twentyfourteen_has_featured_posts() )
     16        get_template_part( 'featured-content' );
     17?>
    1118
    1219    <div id="primary" class="content-area">
     
    2532        </div><!-- #content -->
    2633    </div><!-- #primary -->
     34</div><!-- #main-content -->
    2735
    2836<?php
  • trunk/src/wp-content/themes/twentyfourteen/image.php

    r25769 r25985  
    1313?>
    1414
    15 <section id="primary" class="content-area image-attachment">
    16     <div id="content" class="site-content" role="main">
     15<div id="main-content" class="main-content">
     16    <section id="primary" class="content-area image-attachment">
     17        <div id="content" class="site-content" role="main">
    1718
    18     <?php while ( have_posts() ) : the_post(); ?>
     19        <?php while ( have_posts() ) : the_post(); ?>
    1920
    20         <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    21             <header class="entry-header">
    22                 <?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
     21            <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
     22                <header class="entry-header">
     23                    <?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
    2324
    24                 <div class="entry-meta">
     25                    <div class="entry-meta">
    2526
    26                     <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>
     27                        <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>
    2728
    28                     <span class="full-size-link"><a href="<?php echo wp_get_attachment_url(); ?>"><?php echo $metadata['width']; ?> &times; <?php echo $metadata['height']; ?></a></span>
     29                        <span class="full-size-link"><a href="<?php echo wp_get_attachment_url(); ?>"><?php echo $metadata['width']; ?> &times; <?php echo $metadata['height']; ?></a></span>
    2930
    30                     <span class="parent-post-link"><a href="<?php echo get_permalink( $post->post_parent ); ?>" rel="gallery"><?php echo get_the_title( $post->post_parent ); ?></a></span>
    31                     <?php edit_post_link( __( 'Edit', 'twentyfourteen' ), '<span class="edit-link">', '</span>' ); ?>
    32                 </div><!-- .entry-meta -->
    33             </header><!-- .entry-header -->
     31                        <span class="parent-post-link"><a href="<?php echo get_permalink( $post->post_parent ); ?>" rel="gallery"><?php echo get_the_title( $post->post_parent ); ?></a></span>
     32                        <?php edit_post_link( __( 'Edit', 'twentyfourteen' ), '<span class="edit-link">', '</span>' ); ?>
     33                    </div><!-- .entry-meta -->
     34                </header><!-- .entry-header -->
    3435
    35             <div class="entry-content">
    36                 <div class="entry-attachment">
    37                     <div class="attachment">
    38                         <?php twentyfourteen_the_attached_image(); ?>
    39                     </div><!-- .attachment -->
     36                <div class="entry-content">
     37                    <div class="entry-attachment">
     38                        <div class="attachment">
     39                            <?php twentyfourteen_the_attached_image(); ?>
     40                        </div><!-- .attachment -->
    4041
    41                     <?php if ( has_excerpt() ) : ?>
    42                     <div class="entry-caption">
    43                         <?php the_excerpt(); ?>
    44                     </div><!-- .entry-caption -->
    45                     <?php endif; ?>
    46                 </div><!-- .entry-attachment -->
     42                        <?php if ( has_excerpt() ) : ?>
     43                        <div class="entry-caption">
     44                            <?php the_excerpt(); ?>
     45                        </div><!-- .entry-caption -->
     46                        <?php endif; ?>
     47                    </div><!-- .entry-attachment -->
    4748
    48                 <?php
    49                     the_content();
    50                     wp_link_pages( array(
    51                         'before'      => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentyfourteen' ) . '</span>',
    52                         'after'       => '</div>',
    53                         'link_before' => '<span>',
    54                         'link_after'  => '</span>',
    55                     ) );
    56                 ?>
    57             </div><!-- .entry-content -->
     49                    <?php
     50                        the_content();
     51                        wp_link_pages( array(
     52                            'before'      => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentyfourteen' ) . '</span>',
     53                            'after'       => '</div>',
     54                            'link_before' => '<span>',
     55                            'link_after'  => '</span>',
     56                        ) );
     57                    ?>
     58                </div><!-- .entry-content -->
    5859
    59             <footer class="entry-meta">
    60                 <?php
    61                     if ( comments_open() && pings_open() ) : // Comments and trackbacks open
    62                         printf( __( '<a class="comment-link" href="#respond">Post a comment</a> or leave a trackback: <a class="trackback-link" href="%s" rel="trackback">Trackback URL</a>.', 'twentyfourteen' ), get_trackback_url() );
    63                     elseif ( ! comments_open() && pings_open() ) : // Only trackbacks open
    64                         printf( __( 'Comments are closed, but you can leave a trackback: <a class="trackback-link" href="%s" rel="trackback">Trackback URL</a>.', 'twentyfourteen' ), get_trackback_url() );
    65                     elseif ( comments_open() && ! pings_open() ) : // Only comments open
    66                         _e( 'Trackbacks are closed, but you can <a class="comment-link" href="#respond">post a comment</a>.', 'twentyfourteen' );
    67                     elseif ( ! comments_open() && ! pings_open() ) : // Comments and trackbacks closed
    68                         _e( 'Both comments and trackbacks are currently closed.', 'twentyfourteen' );
    69                     endif;
    70                 ?>
    71             </footer><!-- .entry-meta -->
    72         </article><!-- #post-## -->
     60                <footer class="entry-meta">
     61                    <?php
     62                        if ( comments_open() && pings_open() ) : // Comments and trackbacks open
     63                            printf( __( '<a class="comment-link" href="#respond">Post a comment</a> or leave a trackback: <a class="trackback-link" href="%s" rel="trackback">Trackback URL</a>.', 'twentyfourteen' ), get_trackback_url() );
     64                        elseif ( ! comments_open() && pings_open() ) : // Only trackbacks open
     65                            printf( __( 'Comments are closed, but you can leave a trackback: <a class="trackback-link" href="%s" rel="trackback">Trackback URL</a>.', 'twentyfourteen' ), get_trackback_url() );
     66                        elseif ( comments_open() && ! pings_open() ) : // Only comments open
     67                            _e( 'Trackbacks are closed, but you can <a class="comment-link" href="#respond">post a comment</a>.', 'twentyfourteen' );
     68                        elseif ( ! comments_open() && ! pings_open() ) : // Comments and trackbacks closed
     69                            _e( 'Both comments and trackbacks are currently closed.', 'twentyfourteen' );
     70                        endif;
     71                    ?>
     72                </footer><!-- .entry-meta -->
     73            </article><!-- #post-## -->
    7374
    74         <nav id="image-navigation" class="navigation image-navigation">
    75             <div class="nav-links">
    76             <?php previous_image_link( false, __( '<div class="previous-image">Previous Image</div>', 'twentyfourteen' ) ); ?>
    77             <?php next_image_link( false, __( '<div class="next-image">Next Image</div>', 'twentyfourteen' ) ); ?>
    78             </div><!-- .nav-links -->
    79         </nav><!-- #image-navigation -->
     75            <nav id="image-navigation" class="navigation image-navigation">
     76                <div class="nav-links">
     77                <?php previous_image_link( false, __( '<div class="previous-image">Previous Image</div>', 'twentyfourteen' ) ); ?>
     78                <?php next_image_link( false, __( '<div class="next-image">Next Image</div>', 'twentyfourteen' ) ); ?>
     79                </div><!-- .nav-links -->
     80            </nav><!-- #image-navigation -->
    8081
    81         <?php comments_template(); ?>
     82            <?php comments_template(); ?>
    8283
    83     <?php endwhile; // end of the loop. ?>
     84        <?php endwhile; // end of the loop. ?>
    8485
    85     </div><!-- #content -->
    86 </section><!-- #primary -->
     86        </div><!-- #content -->
     87    </section><!-- #primary -->
     88</div><!-- #main-content -->
    8789
    8890<?php
  • trunk/src/wp-content/themes/twentyfourteen/index.php

    r25769 r25985  
    1515
    1616get_header(); ?>
     17
     18<div id="main-content" class="main-content">
     19
     20<?php
     21    if ( is_front_page() && twentyfourteen_has_featured_posts() )
     22        get_template_part( 'featured-content' );
     23?>
    1724
    1825    <div id="primary" class="content-area">
     
    3643        </div><!-- #content -->
    3744    </div><!-- #primary -->
     45    <?php get_sidebar( 'content' ); ?>
     46</div><!-- #main-content -->
    3847
    3948<?php
    40 get_sidebar( 'content' );
    4149get_sidebar();
    4250get_footer();
  • trunk/src/wp-content/themes/twentyfourteen/page.php

    r25769 r25985  
    1414get_header(); ?>
    1515
     16<div id="main-content" class="main-content">
     17
     18<?php
     19    if ( is_front_page() && twentyfourteen_has_featured_posts() )
     20        get_template_part( 'featured-content' );
     21?>
    1622    <div id="primary" class="content-area">
    1723        <div id="content" class="site-content" role="main">
     
    3137        </div><!-- #content -->
    3238    </div><!-- #primary -->
     39    <?php get_sidebar( 'content' ); ?>
     40</div><!-- #main-content -->
    3341
    3442<?php
    35 get_sidebar( 'content' );
    3643get_sidebar();
    3744get_footer();
  • trunk/src/wp-content/themes/twentyfourteen/search.php

    r25769 r25985  
    1010get_header(); ?>
    1111
     12<div id="main-content" class="main-content">
    1213    <section id="primary" class="content-area">
    1314        <div id="content" class="site-content" role="main">
     
    3536        </div><!-- #content -->
    3637    </section><!-- #primary -->
     38    <?php get_sidebar( 'content' ); ?>
     39</div><!-- #main-content -->
    3740
    3841<?php
    39 get_sidebar( 'content' );
    4042get_sidebar();
    4143get_footer();
     44
  • trunk/src/wp-content/themes/twentyfourteen/single.php

    r25769 r25985  
    1010get_header(); ?>
    1111
    12 <div id="primary" class="content-area">
    13     <div id="content" class="site-content" role="main">
    14         <?php
    15             while ( have_posts() ) :
    16                 the_post();
     12<div id="main-content" class="main-content">
     13    <div id="primary" class="content-area">
     14        <div id="content" class="site-content" role="main">
     15            <?php
     16                while ( have_posts() ) :
     17                    the_post();
    1718
    18                 get_template_part( 'content', get_post_format() );
     19                    get_template_part( 'content', get_post_format() );
    1920
    20                 twentyfourteen_post_nav();
     21                    twentyfourteen_post_nav();
    2122
    22                 // If comments are open or we have at least one comment, load up the comment template.
    23                 if ( comments_open() || get_comments_number() )
    24                     comments_template();
    25             endwhile;
    26         ?>
    27     </div><!-- #content -->
    28 </div><!-- #primary -->
     23                    // If comments are open or we have at least one comment, load up the comment template.
     24                    if ( comments_open() || get_comments_number() )
     25                        comments_template();
     26                endwhile;
     27            ?>
     28        </div><!-- #content -->
     29    </div><!-- #primary -->
     30    <?php get_sidebar( 'content' ); ?>
     31</div><!-- #main-content -->
    2932
    3033<?php
    31 get_sidebar( 'content' );
    3234get_sidebar();
    3335get_footer();
  • trunk/src/wp-content/themes/twentyfourteen/style.css

    r25980 r25985  
    1313Use it to make something cool, have fun, and share what you've learned with others.
    1414*/
    15 
    1615
    1716/**
     
    3534 *   6.9 - Contributor Page
    3635 *   6.10 - 404 Page
    37  *   6.11 - Front Page
    38  *   6.12 - Full-width
    39  *   6.13 - Comments
     36 *   6.11 - Full-width
     37 *   6.12 - Comments
    4038 * 7.0 - Sidebar
    4139 *   7.1 - Widgets
     
    771769}
    772770
     771.main-content {
     772    width: 100%;
     773}
     774
    773775
    774776/**
     
    17221724
    17231725/**
    1724  * 6.11 Front Page
    1725  * -----------------------------------------------------------------------------
    1726  */
    1727 
    1728 .front-page-content-wrapper {
    1729     width: 100%;
    1730 }
    1731 
    1732 
    1733 /**
    1734  * 6.12 Full-width
     1726 * 6.11 Full-width
    17351727 * -----------------------------------------------------------------------------
    17361728 */
     
    17551747
    17561748/**
    1757  * 6.13 Comments
     1749 * 6.12 Comments
    17581750 * -----------------------------------------------------------------------------
    17591751 */
     
    32423234    .search-box-wrapper {
    32433235        padding-left: 182px;
     3236    }
     3237
     3238    .main-content {
     3239        float: left;
    32443240    }
    32453241
     
    33783374    }
    33793375
    3380     .front-page-content-wrapper {
    3381         float: left;
    3382     }
    3383 
    33843376    .featured-content {
    33853377        padding-left: 182px;
  • trunk/src/wp-content/themes/twentyfourteen/tag.php

    r25769 r25985  
    1414get_header(); ?>
    1515
     16<div id="main-content" class="main-content">
    1617    <section id="primary" class="content-area">
    1718        <div id="content" class="site-content" role="main">
     
    4647        </div><!-- #content -->
    4748    </section><!-- #primary -->
     49    <?php get_sidebar( 'content' ); ?>
     50</div><!-- #main-content -->
    4851
    4952<?php
    50 get_sidebar( 'content' );
    5153get_sidebar();
    5254get_footer();
  • trunk/src/wp-content/themes/twentyfourteen/taxonomy-post_format.php

    r25769 r25985  
    1616get_header(); ?>
    1717
     18<div id="main-content" class="main-content">
    1819    <section id="primary" class="content-area">
    1920        <div id="content" class="site-content" role="main">
     
    6566        </div><!-- #content -->
    6667    </section><!-- #primary -->
     68</div><!-- #main-content -->
    6769
    6870<?php
    69 get_sidebar( 'content' );
    7071get_sidebar();
    7172get_footer();
Note: See TracChangeset for help on using the changeset viewer.