From ed2548bb2202e51461ee6ac27826da1c08ea3ba0 Mon Sep 17 00:00:00 2001 From: lancewillett Date: Tue, 14 Feb 2012 03:54:46 +0000 Subject: [PATCH] Twenty Twelve template changes and fixes ... see #19978. * Add custom header support * header.php: use `get_stylesheet_uri()` to load stylesheet, props Mamaduka * Add full-width template, including adding relevant body_class value as a CSS hook * Hide sidebar on all views if no active widgets exist * Fix site title output (was missing site title) * Remove "featured" title for sticky posts * Add content template files for aside, image, link, and quote post formats * Indent content-single.php to match content.php * Remove sample JPG since Twenty Twelve ships with no default header images ... and style updates, props drewstrojny * Better footer styles * Styling for full-width layouts * Add basic styles for archive views * Refine post header/footer styles a bit git-svn-id: http://svn.automattic.com/wordpress/trunk@19915 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-content/themes/twentytwelve/archive.php | 51 +++--- .../themes/twentytwelve/content-aside.php | 29 ++++ .../themes/twentytwelve/content-image.php | 50 ++++++ .../themes/twentytwelve/content-link.php | 29 ++++ .../themes/twentytwelve/content-quote.php | 50 ++++++ .../themes/twentytwelve/content-single.php | 110 ++++++------- wp-content/themes/twentytwelve/content.php | 32 +--- .../themes/twentytwelve/full-width-page.php | 23 +++ wp-content/themes/twentytwelve/functions.php | 147 +++++++++++++++++- wp-content/themes/twentytwelve/header.php | 9 +- .../themes/twentytwelve/images/flowers.jpg | Bin 32407 -> 0 bytes wp-content/themes/twentytwelve/index.php | 5 - wp-content/themes/twentytwelve/sidebar.php | 27 +--- wp-content/themes/twentytwelve/style.css | 50 ++++-- 14 files changed, 458 insertions(+), 154 deletions(-) create mode 100644 wp-content/themes/twentytwelve/content-aside.php create mode 100644 wp-content/themes/twentytwelve/content-image.php create mode 100644 wp-content/themes/twentytwelve/content-link.php create mode 100644 wp-content/themes/twentytwelve/content-quote.php create mode 100644 wp-content/themes/twentytwelve/full-width-page.php delete mode 100644 wp-content/themes/twentytwelve/images/flowers.jpg diff --git a/wp-content/themes/twentytwelve/archive.php b/wp-content/themes/twentytwelve/archive.php index a5548672a7..bbe9b6731c 100644 --- a/wp-content/themes/twentytwelve/archive.php +++ b/wp-content/themes/twentytwelve/archive.php @@ -18,36 +18,31 @@ get_header(); ?>
- - +

' . get_the_date() . '' ); + } elseif ( is_month() ) { + printf( __( 'Monthly Archives: %s', 'twentytwelve' ), '' . get_the_date( _x( 'F Y', 'monthly archives date format', 'twentytwelve' ) ) . '' ); + } elseif ( is_year() ) { + printf( __( 'Yearly Archives: %s', 'twentytwelve' ), '' . get_the_date( _x( 'Y', 'yearly archives date format', 'twentytwelve' ) ) . '' ); + } elseif ( is_tag() ) { + printf( __( 'Tag Archives: %s', 'twentytwelve' ), '' . single_tag_title( '', false ) . '' ); + // Show an optional tag description + $tag_description = tag_description(); + if ( $tag_description ) + echo apply_filters( 'tag_archive_meta', '
' . $tag_description . '
' ); + } elseif ( is_category() ) { + printf( __( 'Category Archives: %s', 'twentytwelve' ), '' . single_cat_title( '', false ) . '' ); + // Show an optional category description + $category_description = category_description(); + if ( $category_description ) + echo apply_filters( 'category_archive_meta', '
' . $category_description . '
' ); + } else { + _e( 'Blog Archives', 'twentytwelve' ); + } + ?>

+ +
> +
+

+
+ +
+ →', 'twentytwelve' ) ); ?> + '' ) ); ?> +
+ +
+ + + | + ' . __( 'Leave a reply', 'twentytwelve' ) . '', __( '1 Reply', 'twentytwelve' ), __( '% Replies', 'twentytwelve' ) ); ?> + + ', '' ); ?> +
+
diff --git a/wp-content/themes/twentytwelve/content-image.php b/wp-content/themes/twentytwelve/content-image.php new file mode 100644 index 0000000000..16d0180497 --- /dev/null +++ b/wp-content/themes/twentytwelve/content-image.php @@ -0,0 +1,50 @@ + + +
> +
+

+ + +
+ +
+ →', 'twentytwelve' ) ); ?> + '' ) ); ?> +
+ +
+ + + Posted in %2$s', 'twentytwelve' ), 'entry-utility-prep entry-utility-prep-cat-links', $categories_list ); ?> + + + + + Tagged %2$s', 'twentytwelve' ), 'entry-utility-prep entry-utility-prep-tag-links', $tags_list ); ?> + + + + + ' . __( 'Leave a reply', 'twentytwelve' ) . '', __( '1 Reply', 'twentytwelve' ), __( '% Replies', 'twentytwelve' ) ); ?> + + + ', '' ); ?> +
+
diff --git a/wp-content/themes/twentytwelve/content-link.php b/wp-content/themes/twentytwelve/content-link.php new file mode 100644 index 0000000000..c062e51cf9 --- /dev/null +++ b/wp-content/themes/twentytwelve/content-link.php @@ -0,0 +1,29 @@ + + +
> +
+

+
+ +
+ →', 'twentytwelve' ) ); ?> + '' ) ); ?> +
+ +
+ + + | + ' . __( 'Leave a reply', 'twentytwelve' ) . '', __( '1 Reply', 'twentytwelve' ), __( '% Replies', 'twentytwelve' ) ); ?> + + ', '' ); ?> +
+
diff --git a/wp-content/themes/twentytwelve/content-quote.php b/wp-content/themes/twentytwelve/content-quote.php new file mode 100644 index 0000000000..be809bb63a --- /dev/null +++ b/wp-content/themes/twentytwelve/content-quote.php @@ -0,0 +1,50 @@ + + +
> +
+

+ + +
+ +
+ →', 'twentytwelve' ) ); ?> + '' ) ); ?> +
+ +
+ + + Posted in %2$s', 'twentytwelve' ), 'entry-utility-prep entry-utility-prep-cat-links', $categories_list ); ?> + + + + + Tagged %2$s', 'twentytwelve' ), 'entry-utility-prep entry-utility-prep-tag-links', $tags_list ); ?> + + + + + ' . __( 'Leave a reply', 'twentytwelve' ) . '', __( '1 Reply', 'twentytwelve' ), __( '% Replies', 'twentytwelve' ) ); ?> + + + ', '' ); ?> +
+
diff --git a/wp-content/themes/twentytwelve/content-single.php b/wp-content/themes/twentytwelve/content-single.php index 2d80e9c3eb..498bbc4e1a 100644 --- a/wp-content/themes/twentytwelve/content-single.php +++ b/wp-content/themes/twentytwelve/content-single.php @@ -8,64 +8,64 @@ */ ?> -
> -
-

+
> +
+

- - - -
+ + + +
-
- - '' ) ); ?> -
+
+ + '' ) ); ?> +
-
- + %5$s. Bookmark the permalink.', 'twentytwelve' ); - } elseif ( '' != $categories_list ) { - $utility_text = __( 'This entry was posted in %1$s by %5$s. Bookmark the permalink.', 'twentytwelve' ); - } else { - $utility_text = __( 'This entry was posted by %5$s. Bookmark the permalink.', 'twentytwelve' ); - } + /* translators: used between list items, there is a space after the comma */ + $tag_list = get_the_tag_list( '', __( ', ', 'twentytwelve' ) ); + if ( '' != $tag_list ) { + $utility_text = __( 'This entry was posted in %1$s and tagged %2$s by %5$s. Bookmark the permalink.', 'twentytwelve' ); + } elseif ( '' != $categories_list ) { + $utility_text = __( 'This entry was posted in %1$s by %5$s. Bookmark the permalink.', 'twentytwelve' ); + } else { + $utility_text = __( 'This entry was posted by %5$s. Bookmark the permalink.', 'twentytwelve' ); + } - printf( - $utility_text, - $categories_list, - $tag_list, - esc_url( get_permalink() ), - the_title_attribute( 'echo=0' ), - get_the_author(), - esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) - ); - ?> - ', '' ); ?> + printf( + $utility_text, + $categories_list, + $tag_list, + esc_url( get_permalink() ), + the_title_attribute( 'echo=0' ), + get_the_author(), + esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) + ); + ?> + ', '' ); ?> - - - -
-
+ + + + + diff --git a/wp-content/themes/twentytwelve/content.php b/wp-content/themes/twentytwelve/content.php index fe0933a80f..cfbb97e065 100644 --- a/wp-content/themes/twentytwelve/content.php +++ b/wp-content/themes/twentytwelve/content.php @@ -1,6 +1,6 @@ " >
- -
-

-

-
-

- - +
- +
@@ -38,36 +31,27 @@