Twenty Twelve: rename custom page templates and place in sub-directory. Closes #21715.

git-svn-id: http://core.svn.wordpress.org/trunk@21642 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Lance Willett 2012-08-28 17:12:10 +00:00
parent c0fc21a02d
commit 792b454c6d
5 changed files with 38 additions and 32 deletions

View File

@ -362,11 +362,14 @@ endif;
function twentytwelve_body_class( $classes ) { function twentytwelve_body_class( $classes ) {
$background_color = get_background_color(); $background_color = get_background_color();
if ( ! is_active_sidebar( 1 ) || is_page_template( 'full-width-page.php' ) ) if ( ! is_active_sidebar( 1 ) || is_page_template( 'page-templates/full-width.php' ) )
$classes[] = 'full-width'; $classes[] = 'full-width';
if ( is_page_template( 'homepage.php' ) && has_post_thumbnail() ) if ( is_page_template( 'page-templates/home.php' ) ) {
$classes[] = 'has-post-thumbnail'; $classes[] = 'template-home';
if ( has_post_thumbnail() )
$classes[] = 'has-post-thumbnail';
}
if ( empty( $background_color ) ) if ( empty( $background_color ) )
$classes[] = 'custom-background-empty'; $classes[] = 'custom-background-empty';
@ -384,7 +387,7 @@ add_filter( 'body_class', 'twentytwelve_body_class' );
* @since Twenty Twelve 1.0 * @since Twenty Twelve 1.0
*/ */
function twentytwelve_content_width() { function twentytwelve_content_width() {
if ( is_page_template( 'full-width-page.php' ) || is_attachment() || ! is_active_sidebar( 1 ) ) { if ( is_page_template( 'page-templates/full-width.php' ) || is_attachment() || ! is_active_sidebar( 1 ) ) {
global $content_width; global $content_width;
$content_width = 960; $content_width = 960;
} }

View File

@ -1,6 +1,8 @@
<?php <?php
/** /**
* Template Name: Full-width page, no sidebar * Template Name: Full-width Page Template, No Sidebar
*
* @todo Better documentation here.
* *
* @package WordPress * @package WordPress
* @subpackage Twenty_Twelve * @subpackage Twenty_Twelve

View File

@ -1,6 +1,8 @@
<?php <?php
/** /**
* Template Name: Homepage * Template Name: Homepage Template
*
* @todo Better documentation here.
* *
* @package WordPress * @package WordPress
* @subpackage Twenty_Twelve * @subpackage Twenty_Twelve

16
rtl.css
View File

@ -139,7 +139,7 @@ label ~ span.required {
/* =Home page template styling /* =Home page template styling
-------------------------------------------------------------- */ -------------------------------------------------------------- */
.page-template-homepage-php .widget-area .widget_text img { .template-home .widget-area .widget_text img {
float: right; float: right;
margin: 8px 0 8px 24px; margin: 8px 0 8px 24px;
margin: 0.571428571rem 0 0.571428571rem 1.714285714rem; margin: 0.571428571rem 0 0.571428571rem 1.714285714rem;
@ -178,7 +178,7 @@ label ~ span.required {
/* Minimum width of 600 pixels. */ /* Minimum width of 600 pixels. */
@media screen and (min-width: 600px) { @media screen and (min-width: 600px) {
.site-content, .site-content,
.page-template-homepage-php.has-post-thumbnail article { .template-home.has-post-thumbnail article {
float: right; float: right;
} }
.widget-area, .widget-area,
@ -193,19 +193,19 @@ label ~ span.required {
.entry-summary p { .entry-summary p {
text-align: right; text-align: right;
} }
.page-template-homepage-php .widget-area .widget_text img { .template-home .widget-area .widget_text img {
float: right; float: right;
margin: 8px 0 8px 24px; margin: 8px 0 8px 24px;
} }
.page-template-homepage-php .widget-area .widget, .template-home .widget-area .widget,
.page-template-homepage-php .widget-area.two .home-widgets { .template-home .widget-area.two .home-widgets {
float: right; float: right;
} }
.page-template-homepage-php .widget-area .widget:nth-child(odd) { .template-home .widget-area .widget:nth-child(odd) {
clear: left; clear: left;
} }
.page-template-homepage-php .widget-area .widget:nth-child(even), .template-home .widget-area .widget:nth-child(even),
.page-template-homepage-php .widget-area.two .home-widgets + .home-widgets { .template-home .widget-area.two .home-widgets + .home-widgets {
float: left; float: left;
margin: 0 24px 0; margin: 0 24px 0;
margin: 0 1.714285714rem 0; margin: 0 1.714285714rem 0;

View File

@ -1199,11 +1199,11 @@ label ~ span.required {
margin-bottom: 14px; margin-bottom: 14px;
margin-bottom: 1rem; margin-bottom: 1rem;
} }
.page-template-homepage-php .site-content article { .template-home .site-content article {
border: 0; border: 0;
margin-bottom: 0; margin-bottom: 0;
} }
.page-template-homepage-php .widget-area { .template-home .widget-area {
clear: both; clear: both;
float: none; float: none;
width: auto; width: auto;
@ -1211,7 +1211,7 @@ label ~ span.required {
padding-top: 1.714285714rem; padding-top: 1.714285714rem;
border-top: 1px solid #ededed; border-top: 1px solid #ededed;
} }
.page-template-homepage-php .widget-area .widget li { .template-home .widget-area .widget li {
margin: 8px 0 0; margin: 8px 0 0;
margin: 0.571428571rem 0 0; margin: 0.571428571rem 0 0;
font-size: 13px; font-size: 13px;
@ -1220,13 +1220,13 @@ label ~ span.required {
list-style-type: square; list-style-type: square;
list-style-position: inside; list-style-position: inside;
} }
.page-template-homepage-php .widget-area .widget li a { .template-home .widget-area .widget li a {
color: #777; color: #777;
} }
.page-template-homepage-php .widget-area .widget li a:hover { .template-home .widget-area .widget li a:hover {
color: #21759b; color: #21759b;
} }
.page-template-homepage-php .widget-area .widget_text img { .template-home .widget-area .widget_text img {
float: left; float: left;
margin: 8px 24px 8px 0; margin: 8px 24px 8px 0;
margin: 0.571428571rem 1.714285714rem 0.571428571rem 0; margin: 0.571428571rem 1.714285714rem 0.571428571rem 0;
@ -1324,8 +1324,7 @@ img#wpstats {
float: left; float: left;
width: 65.104166667%; width: 65.104166667%;
} }
body.page-template-full-width-page-php .site-content, body.template-home .site-content,
body.page-template-homepage-php .site-content,
body.single-attachment .site-content, body.single-attachment .site-content,
body.full-width .site-content { body.full-width .site-content {
width: 100%; width: 100%;
@ -1428,11 +1427,11 @@ img#wpstats {
#respond form textarea.blog-textarea { #respond form textarea.blog-textarea {
width: 79.666666667%; width: 79.666666667%;
} }
.page-template-homepage-php .site-content, .template-home .site-content,
.page-template-homepage-php article { .template-home article {
overflow: hidden; overflow: hidden;
} }
.page-template-homepage-php.has-post-thumbnail article { .template-home.has-post-thumbnail article {
float: left; float: left;
width: 47.916666667%; width: 47.916666667%;
} }
@ -1441,25 +1440,25 @@ img#wpstats {
margin-bottom: 0; margin-bottom: 0;
width: 47.916666667%; width: 47.916666667%;
} }
.page-template-homepage-php .widget-area .widget, .template-home .widget-area .widget,
.page-template-homepage-php .widget-area.two .home-widgets { .template-home .widget-area.two .home-widgets {
float: left; float: left;
width: 51.875%; width: 51.875%;
margin-bottom: 24px; margin-bottom: 24px;
margin-bottom: 1.714285714rem; margin-bottom: 1.714285714rem;
} }
.page-template-homepage-php .widget-area .widget:nth-child(odd) { .template-home .widget-area .widget:nth-child(odd) {
clear: right; clear: right;
} }
.page-template-homepage-php .widget-area .widget:nth-child(even), .template-home .widget-area .widget:nth-child(even),
.page-template-homepage-php .widget-area.two .home-widgets + .home-widgets { .template-home .widget-area.two .home-widgets + .home-widgets {
float: right; float: right;
width: 39.0625%; width: 39.0625%;
margin: 0 0 24px; margin: 0 0 24px;
margin: 0 0 1.714285714rem; margin: 0 0 1.714285714rem;
} }
.page-template-homepage-php .widget-area.two .widget, .template-home .widget-area.two .widget,
.page-template-homepage-php .widget-area.two .widget:nth-child(even) { .template-home .widget-area.two .widget:nth-child(even) {
float: none; float: none;
width: auto; width: auto;
} }