WordPress.org

Make WordPress Core

Ticket #21909: 21909.2.diff

File 21909.2.diff, 13.4 KB (added by lancewillett, 6 years ago)
  • wp-content/themes/twentytwelve/style.css

     
    33Theme URI: http://wordpress.org/extend/themes/twentytwelve
    44Author: the WordPress team
    55Author URI: http://wordpress.org/
    6 Description: The 2012 theme for WordPress is a fully responsive theme that looks great on any device. Features include a homepage template with a its own widgets, an optional display font, styling for post formats on both index and single views, and an optional no-sidebar page template. Make it yours with a custom menu, header image, and background.
     6Description: The 2012 theme for WordPress is a fully responsive theme that looks great on any device. Features include a front-page template with a its own widgets, an optional display font, styling for post formats on both index and single views, and an optional no-sidebar page template. Make it yours with a custom menu, header image, and background.
    77Version: 0.9
    88License: GNU General Public License v2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    12041204}
    12051205
    12061206
    1207 /* =Homepage template
     1207/* =Front page template
    12081208-------------------------------------------------------------- */
    12091209
    12101210.entry-page-image {
    12111211        margin-bottom: 14px;
    12121212        margin-bottom: 1rem;
    12131213}
    1214 .template-home .site-content article {
     1214.template-front-page .site-content article {
    12151215        border: 0;
    12161216        margin-bottom: 0;
    12171217}
    1218 .template-home .widget-area {
     1218.template-front-page .widget-area {
    12191219        clear: both;
    12201220        float: none;
    12211221        width: auto;
     
    12231223        padding-top: 1.714285714rem;
    12241224        border-top: 1px solid #ededed;
    12251225}
    1226 .template-home .widget-area .widget li {
     1226.template-front-page .widget-area .widget li {
    12271227        margin: 8px 0 0;
    12281228        margin: 0.571428571rem 0 0;
    12291229        font-size: 13px;
     
    12321232        list-style-type: square;
    12331233        list-style-position: inside;
    12341234}
    1235 .template-home .widget-area .widget li a {
     1235.template-front-page .widget-area .widget li a {
    12361236        color: #777;
    12371237}
    1238 .template-home .widget-area .widget li a:hover {
     1238.template-front-page .widget-area .widget li a:hover {
    12391239        color: #21759b;
    12401240}
    1241 .template-home .widget-area .widget_text img {
     1241.template-front-page .widget-area .widget_text img {
    12421242        float: left;
    12431243        margin: 8px 24px 8px 0;
    12441244        margin: 0.571428571rem 1.714285714rem 0.571428571rem 0;
     
    13311331                float: left;
    13321332                width: 65.104166667%;
    13331333        }
    1334         body.template-home .site-content,
     1334        body.template-front-page .site-content,
    13351335        body.single-attachment .site-content,
    13361336        body.full-width .site-content {
    13371337                width: 100%;
     
    14341434        #respond form textarea.blog-textarea {
    14351435                width: 79.666666667%;
    14361436        }
    1437         .template-home .site-content,
    1438         .template-home article {
     1437        .template-front-page .site-content,
     1438        .template-front-page article {
    14391439                overflow: hidden;
    14401440        }
    1441         .template-home.has-post-thumbnail article {
     1441        .template-front-page.has-post-thumbnail article {
    14421442                float: left;
    14431443                width: 47.916666667%;
    14441444        }
     
    14471447                margin-bottom: 0;
    14481448                width: 47.916666667%;
    14491449        }
    1450         .template-home .widget-area .widget,
    1451         .template-home .widget-area.two .home-widgets {
     1450        .template-front-page .widget-area .widget,
     1451        .template-front-page .widget-area.two .front-widgets {
    14521452                float: left;
    14531453                width: 51.875%;
    14541454                margin-bottom: 24px;
    14551455                margin-bottom: 1.714285714rem;
    14561456        }
    1457         .template-home .widget-area .widget:nth-child(odd) {
     1457        .template-front-page .widget-area .widget:nth-child(odd) {
    14581458                clear: right;
    14591459        }
    1460         .template-home .widget-area .widget:nth-child(even),
    1461         .template-home .widget-area.two .home-widgets + .home-widgets {
     1460        .template-front-page .widget-area .widget:nth-child(even),
     1461        .template-front-page .widget-area.two .front-widgets + .front-widgets {
    14621462                float: right;
    14631463                width: 39.0625%;
    14641464                margin: 0 0 24px;
    14651465                margin: 0 0 1.714285714rem;
    14661466        }
    1467         .template-home .widget-area.two .widget,
    1468         .template-home .widget-area.two .widget:nth-child(even) {
     1467        .template-front-page .widget-area.two .widget,
     1468        .template-front-page .widget-area.two .widget:nth-child(even) {
    14691469                float: none;
    14701470                width: auto;
    14711471        }
  • wp-content/themes/twentytwelve/sidebar-home.php

     
    1 <?php
    2 /**
    3  * The sidebar containing the homepage widget areas.
    4  *
    5  * If no active widgets in either sidebar, they will be hidden completely.
    6  *
    7  * @package WordPress
    8  * @subpackage Twenty_Twelve
    9  * @since Twenty Twelve 1.0
    10  */
    11 
    12 /*
    13  * The homepage widget area is triggered if any of the areas
    14  * have widgets. So let's check that first.
    15  *
    16  * If none of the sidebars have widgets, then let's bail early.
    17  */
    18 if ( ! is_active_sidebar( 'sidebar-2' ) && ! is_active_sidebar( 'sidebar-3' ) )
    19         return;
    20 
    21 // If we get this far, we have widgets. Let do this.
    22 ?>
    23 <div id="secondary" <?php twentytwelve_homepage_sidebar_class(); ?> role="complementary">
    24         <?php if ( is_active_sidebar( 'sidebar-2' ) ) : ?>
    25         <div class="first home-widgets">
    26                 <?php dynamic_sidebar( 'sidebar-2' ); ?>
    27         </div><!-- .first -->
    28         <?php endif; ?>
    29 
    30         <?php if ( is_active_sidebar( 'sidebar-3' ) ) : ?>
    31         <div class="second home-widgets">
    32                 <?php dynamic_sidebar( 'sidebar-3' ); ?>
    33         </div><!-- .second -->
    34         <?php endif; ?>
    35 </div><!-- #secondary -->
    36  No newline at end of file
  • wp-content/themes/twentytwelve/sidebar-front.php

     
    11<?php
    22/**
    3  * The sidebar containing the homepage widget areas.
     3 * The sidebar containing the front page widget areas.
    44 *
    55 * If no active widgets in either sidebar, they will be hidden completely.
    66 *
     
    1010 */
    1111
    1212/*
    13  * The homepage widget area is triggered if any of the areas
     13 * The front page widget area is triggered if any of the areas
    1414 * have widgets. So let's check that first.
    1515 *
    1616 * If none of the sidebars have widgets, then let's bail early.
     
    2020
    2121// If we get this far, we have widgets. Let do this.
    2222?>
    23 <div id="secondary" <?php twentytwelve_homepage_sidebar_class(); ?> role="complementary">
     23<div id="secondary" <?php twentytwelve_frontpage_sidebar_class(); ?> role="complementary">
    2424        <?php if ( is_active_sidebar( 'sidebar-2' ) ) : ?>
    25         <div class="first home-widgets">
     25        <div class="first front-widgets">
    2626                <?php dynamic_sidebar( 'sidebar-2' ); ?>
    2727        </div><!-- .first -->
    2828        <?php endif; ?>
    2929
    3030        <?php if ( is_active_sidebar( 'sidebar-3' ) ) : ?>
    31         <div class="second home-widgets">
     31        <div class="second front-widgets">
    3232                <?php dynamic_sidebar( 'sidebar-3' ); ?>
    3333        </div><!-- .second -->
    3434        <?php endif; ?>
  • wp-content/themes/twentytwelve/rtl.css

     
    146146}
    147147
    148148
    149 /* =Home page template styling
     149/* =Front page template styling
    150150-------------------------------------------------------------- */
    151151
    152 .template-home .widget-area .widget_text img {
     152.template-front-page .widget-area .widget_text img {
    153153        float: right;
    154154        margin: 8px 0 8px 24px;
    155155        margin: 0.571428571rem 0 0.571428571rem 1.714285714rem;
     
    188188/* Minimum width of 600 pixels. */
    189189@media screen and (min-width: 600px) {
    190190        .site-content,
    191         .template-home.has-post-thumbnail article {
     191        .template-front-page.has-post-thumbnail article {
    192192                float: right;
    193193        }
    194194        .widget-area,
     
    199199        .site-header h2 {
    200200                text-align: right;
    201201        }
    202         .template-home .widget-area .widget_text img {
     202        .template-front-page .widget-area .widget_text img {
    203203                float: right;
    204204                margin: 8px 0 8px 24px;
    205205        }
    206         .template-home .widget-area .widget,
    207         .template-home .widget-area.two .home-widgets {
     206        .template-front-page .widget-area .widget,
     207        .template-front-page .widget-area.two .front-widgets {
    208208                float: right;
    209209        }
    210         .template-home .widget-area .widget:nth-child(odd) {
     210        .template-front-page .widget-area .widget:nth-child(odd) {
    211211                clear: left;
    212212        }
    213         .template-home .widget-area .widget:nth-child(even),
    214         .template-home .widget-area.two .home-widgets + .home-widgets {
     213        .template-front-page .widget-area .widget:nth-child(even),
     214        .template-front-page .widget-area.two .front-widgets + .front-widgets {
    215215                float: left;
    216216                margin: 0 24px 0;
    217217                margin: 0 1.714285714rem 0;
  • wp-content/themes/twentytwelve/functions.php

     
    179179add_filter( 'wp_page_menu_args', 'twentytwelve_page_menu_args' );
    180180
    181181/**
    182  * Registers our main widget area and the homepage widget areas.
     182 * Registers our main widget area and the front page widget areas.
    183183 *
    184184 * @since Twenty Twelve 1.0
    185185 */
     
    187187        register_sidebar( array(
    188188                'name' => __( 'Main Sidebar', 'twentytwelve' ),
    189189                'id' => 'sidebar-1',
    190                 'description' => __( 'Appears on posts and pages except the optional Homepage template, which has its own widgets', 'twentytwelve' ),
     190                'description' => __( 'Appears on posts and pages except the optional Front Page template, which has its own widgets', 'twentytwelve' ),
    191191                'before_widget' => '<aside id="%1$s" class="widget %2$s">',
    192192                'after_widget' => '</aside>',
    193193                'before_title' => '<h3 class="widget-title">',
     
    195195        ) );
    196196
    197197        register_sidebar( array(
    198                 'name' => __( 'First Homepage Widget Area', 'twentytwelve' ),
     198                'name' => __( 'First Front Page Widget Area', 'twentytwelve' ),
    199199                'id' => 'sidebar-2',
    200                 'description' => __( 'Appears when using the optional homepage template with a page set as Static Front Page', 'twentytwelve' ),
     200                'description' => __( 'Appears when using the optional Front Page template with a page set as Static Front Page', 'twentytwelve' ),
    201201                'before_widget' => '<aside id="%1$s" class="widget %2$s">',
    202202                'after_widget' => '</aside>',
    203203                'before_title' => '<h3 class="widget-title">',
     
    205205        ) );
    206206
    207207        register_sidebar( array(
    208                 'name' => __( 'Second Homepage Widget Area', 'twentytwelve' ),
     208                'name' => __( 'Second Front Page Widget Area', 'twentytwelve' ),
    209209                'id' => 'sidebar-3',
    210                 'description' => __( 'Appears when using the optional homepage template with a page set as Static Front Page', 'twentytwelve' ),
     210                'description' => __( 'Appears when using the optional Front Page template with a page set as Static Front Page', 'twentytwelve' ),
    211211                'before_widget' => '<aside id="%1$s" class="widget %2$s">',
    212212                'after_widget' => '</aside>',
    213213                'before_title' => '<h3 class="widget-title">',
     
    221221 *
    222222 * @since Twenty Twelve 1.0
    223223 */
    224 function twentytwelve_homepage_sidebar_class() {
     224function twentytwelve_frontpage_sidebar_class() {
    225225        $classes = array( 'widget-area' );
    226226
    227227        if ( is_active_sidebar( 'sidebar-2' ) && is_active_sidebar( 'sidebar-3' ) )
     
    364364 * Extends the default WordPress body class to denote:
    365365 * 1. Using a full-width layout, when no active widgets in the sidebar
    366366 *    or full-width template.
    367  * 2. A thumbnail in the Homepage page template.
     367 * 2. A thumbnail in the Front Page template.
    368368 * 3. White or empty background color to change the layout and spacing.
    369369 *
    370370 * @since Twenty Twelve 1.0
     
    378378        if ( ! is_active_sidebar( 'sidebar-1' ) || is_page_template( 'page-templates/full-width.php' ) )
    379379                $classes[] = 'full-width';
    380380
    381         if ( is_page_template( 'page-templates/home.php' ) ) {
    382                 $classes[] = 'template-home';
     381        if ( is_page_template( 'page-templates/front-page.php' ) ) {
     382                $classes[] = 'template-front-page';
    383383                if ( has_post_thumbnail() )
    384384                        $classes[] = 'has-post-thumbnail';
    385385        }
  • wp-content/themes/twentytwelve/page-templates/front-page.php

     
    11<?php
    22/**
    3  * Template Name: Homepage Template
     3 * Template Name: Front Page Template
    44 *
    55 * @todo Better documentation here.
    66 *
     
    2828                </div><!-- #content -->
    2929        </div><!-- #primary -->
    3030
    31 <?php get_sidebar( 'home' ); ?>
     31<?php get_sidebar( 'front' ); ?>
    3232<?php get_footer(); ?>
     33 No newline at end of file
  • wp-content/themes/twentytwelve/page-templates/home.php

     
    1 <?php
    2 /**
    3  * Template Name: Homepage Template
    4  *
    5  * @todo Better documentation here.
    6  *
    7  * @package WordPress
    8  * @subpackage Twenty_Twelve
    9  * @since Twenty Twelve 1.0
    10  */
    11 
    12 get_header(); ?>
    13 
    14         <div id="primary" class="site-content">
    15                 <div id="content" role="main">
    16 
    17                         <?php while ( have_posts() ) : the_post(); ?>
    18                                 <?php if ( has_post_thumbnail() ) : ?>
    19                                         <div class="entry-page-image">
    20                                                 <?php the_post_thumbnail(); ?>
    21                                         </div><!-- .entry-page-image -->
    22                                 <?php endif; ?>
    23 
    24                                 <?php get_template_part( 'content', 'page' ); ?>
    25 
    26                         <?php endwhile; // end of the loop. ?>
    27 
    28                 </div><!-- #content -->
    29         </div><!-- #primary -->
    30 
    31 <?php get_sidebar( 'home' ); ?>
    32 <?php get_footer(); ?>
    33  No newline at end of file