Make WordPress Core

Changeset 19915


Ignore:
Timestamp:
02/14/2012 03:54:46 AM (15 years ago)
Author:
lancewillett
Message:

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
Location:
trunk/wp-content/themes/twentytwelve
Files:
5 added
1 deleted
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-content/themes/twentytwelve/archive.php

    r19843 r19915  
    1919
    2020                <?php if ( have_posts() ) : ?>
    21 
    22                         <header class="page-header">
    23                                 <h1 class="page-title"><?php
    24                                         if ( is_day() ) {
    25                                                 printf( __( 'Daily Archives: %s', 'twentytwelve' ), '<span>' . get_the_date() . '</span>' );
    26                                         } elseif ( is_month() ) {
    27                                                 printf( __( 'Monthly Archives: %s', 'twentytwelve' ), '<span>' . get_the_date( _x( 'F Y', 'monthly archives date format', 'twentytwelve' ) ) . '</span>' );
    28                                         } elseif ( is_year() ) {
    29                                                 printf( __( 'Yearly Archives: %s', 'twentytwelve' ), '<span>' . get_the_date( _x( 'Y', 'yearly archives date format', 'twentytwelve' ) ) . '</span>' );
    30                                         } elseif ( is_tag() ) {
    31                                                 printf( __( 'Tag Archives: %s', 'twentytwelve' ), '<span>' . single_tag_title( '', false ) . '</span>' );
    32                                                 // Show an optional tag description
    33                                                 $tag_description = tag_description();
    34                                                 if ( $tag_description )
    35                                                         echo apply_filters( 'tag_archive_meta', '<div class="tag-archive-meta">' . $tag_description . '</div>' );
    36                                         } elseif ( is_category() ) {
    37                                                 printf( __( 'Category Archives: %s', 'twentytwelve' ), '<span>' . single_cat_title( '', false ) . '</span>' );
    38                                                 // Show an optional category description
    39                                                 $category_description = category_description();
    40                                                 if ( $category_description )
    41                                                         echo apply_filters( 'category_archive_meta', '<div class="category-archive-meta">' . $category_description . '</div>' );
    42                                         } else {
    43                                                 _e( 'Blog Archives', 'twentytwelve' );
    44                                         }
    45                                 ?></h1>
    46                         </header>
     21                        <h1 class="archive-title all-caps-title"><?php
     22                                if ( is_day() ) {
     23                                        printf( __( 'Daily Archives: %s', 'twentytwelve' ), '<span>' . get_the_date() . '</span>' );
     24                                } elseif ( is_month() ) {
     25                                        printf( __( 'Monthly Archives: %s', 'twentytwelve' ), '<span>' . get_the_date( _x( 'F Y', 'monthly archives date format', 'twentytwelve' ) ) . '</span>' );
     26                                } elseif ( is_year() ) {
     27                                        printf( __( 'Yearly Archives: %s', 'twentytwelve' ), '<span>' . get_the_date( _x( 'Y', 'yearly archives date format', 'twentytwelve' ) ) . '</span>' );
     28                                } elseif ( is_tag() ) {
     29                                        printf( __( 'Tag Archives: %s', 'twentytwelve' ), '<span>' . single_tag_title( '', false ) . '</span>' );
     30                                        // Show an optional tag description
     31                                        $tag_description = tag_description();
     32                                        if ( $tag_description )
     33                                                echo apply_filters( 'tag_archive_meta', '<div class="tag-archive-meta">' . $tag_description . '</div>' );
     34                                } elseif ( is_category() ) {
     35                                        printf( __( 'Category Archives: %s', 'twentytwelve' ), '<span>' . single_cat_title( '', false ) . '</span>' );
     36                                        // Show an optional category description
     37                                        $category_description = category_description();
     38                                        if ( $category_description )
     39                                                echo apply_filters( 'category_archive_meta', '<div class="category-archive-meta">' . $category_description . '</div>' );
     40                                } else {
     41                                        _e( 'Blog Archives', 'twentytwelve' );
     42                                }
     43                        ?></h1>
    4744
    4845                        <?php
    49                         twentytwelve_content_nav( 'nav-above' );
    50                        
    5146                        /* Start the Loop */
    5247                        while ( have_posts() ) : the_post();
  • trunk/wp-content/themes/twentytwelve/content-single.php

    r19842 r19915  
    99?>
    1010
    11 <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    12         <header class="entry-header">
    13                 <h1 class="entry-title"><?php the_title(); ?></h1>
     11        <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
     12                <header class="entry-header">
     13                        <h1 class="entry-title"><?php the_title(); ?></h1>
    1414
    15                 <?php if ( 'post' == get_post_type() ) : ?>
    16                 <div class="entry-meta">
    17                         <?php twentytwelve_posted_on(); ?>
    18                 </div><!-- .entry-meta -->
    19                 <?php endif; ?>
    20         </header><!-- .entry-header -->
     15                        <?php if ( 'post' == get_post_type() ) : // Hide entry meta for pages ?>
     16                        <div class="entry-meta">
     17                                <?php twentytwelve_posted_on(); ?>
     18                        </div><!-- .entry-meta -->
     19                        <?php endif; ?>
     20                </header><!-- .entry-header -->
    2121
    22         <div class="entry-content">
    23                 <?php the_content(); ?>
    24                 <?php wp_link_pages( array( 'before' => '<div class="page-links">' . __( 'Pages:', 'twentytwelve' ), 'after' => '</div>' ) ); ?>
    25         </div><!-- .entry-content -->
     22                <div class="entry-content">
     23                        <?php the_content(); ?>
     24                        <?php wp_link_pages( array( 'before' => '<div class="page-links">' . __( 'Pages:', 'twentytwelve' ), 'after' => '</div>' ) ); ?>
     25                </div><!-- .entry-content -->
    2626
    27         <footer class="entry-meta">
    28                 <?php
    29                         /* translators: used between list items, there is a space after the comma */
    30                         $categories_list = get_the_category_list( __( ', ', 'twentytwelve' ) );
     27                <footer class="entry-meta">
     28                        <?php
     29                                /* translators: used between list items, there is a space after the comma */
     30                                $categories_list = get_the_category_list( __( ', ', 'twentytwelve' ) );
    3131
    32                         /* translators: used between list items, there is a space after the comma */
    33                         $tag_list = get_the_tag_list( '', __( ', ', 'twentytwelve' ) );
    34                         if ( '' != $tag_list ) {
    35                                 $utility_text = __( 'This entry was posted in %1$s and tagged %2$s by <a href="%6$s">%5$s</a>. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'twentytwelve' );
    36                         } elseif ( '' != $categories_list ) {
    37                                 $utility_text = __( 'This entry was posted in %1$s by <a href="%6$s">%5$s</a>. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'twentytwelve' );
    38                         } else {
    39                                 $utility_text = __( 'This entry was posted by <a href="%6$s">%5$s</a>. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'twentytwelve' );
    40                         }
     32                                /* translators: used between list items, there is a space after the comma */
     33                                $tag_list = get_the_tag_list( '', __( ', ', 'twentytwelve' ) );
     34                                if ( '' != $tag_list ) {
     35                                        $utility_text = __( 'This entry was posted in %1$s and tagged %2$s by <a href="%6$s">%5$s</a>. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'twentytwelve' );
     36                                } elseif ( '' != $categories_list ) {
     37                                        $utility_text = __( 'This entry was posted in %1$s by <a href="%6$s">%5$s</a>. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'twentytwelve' );
     38                                } else {
     39                                        $utility_text = __( 'This entry was posted by <a href="%6$s">%5$s</a>. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'twentytwelve' );
     40                                }
    4141
    42                         printf(
    43                                 $utility_text,
    44                                 $categories_list,
    45                                 $tag_list,
    46                                 esc_url( get_permalink() ),
    47                                 the_title_attribute( 'echo=0' ),
    48                                 get_the_author(),
    49                                 esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) )
    50                         );
    51                 ?>
    52                 <?php edit_post_link( __( 'Edit', 'twentytwelve' ), '<span class="edit-link">', '</span>' ); ?>
     42                                printf(
     43                                        $utility_text,
     44                                        $categories_list,
     45                                        $tag_list,
     46                                        esc_url( get_permalink() ),
     47                                        the_title_attribute( 'echo=0' ),
     48                                        get_the_author(),
     49                                        esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) )
     50                                );
     51                        ?>
     52                        <?php edit_post_link( __( 'Edit', 'twentytwelve' ), '<span class="edit-link">', '</span>' ); ?>
    5353
    54                 <?php if ( get_the_author_meta( 'description' ) && ( ! function_exists( 'is_multi_author' ) || is_multi_author() ) ) : // If a user has filled out their description and this is a multi-author blog, show a bio on their entries ?>
    55                 <div id="author-info">
    56                         <div id="author-avatar">
    57                                 <?php echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'twentytwelve_author_bio_avatar_size', 68 ) ); ?>
    58                         </div><!-- #author-avatar -->
    59                         <div id="author-description">
    60                                 <h2><?php printf( __( 'About %s', 'twentytwelve' ), get_the_author() ); ?></h2>
    61                                 <?php the_author_meta( 'description' ); ?>
    62                                 <div id="author-link">
    63                                         <a href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>" rel="author">
    64                                                 <?php printf( __( 'View all posts by %s <span class="meta-nav">&rarr;</span>', 'twentytwelve' ), get_the_author() ); ?>
    65                                         </a>
    66                                 </div><!-- #author-link -->
    67                         </div><!-- #author-description -->
    68                 </div><!-- #entry-author-info -->
    69                 <?php endif; ?>
    70         </footer><!-- .entry-meta -->
    71 </article><!-- #post -->
     54                        <?php if ( get_the_author_meta( 'description' ) && ( ! function_exists( 'is_multi_author' ) || is_multi_author() ) ) : // If a user has filled out their description and this is a multi-author blog, show a bio on their entries ?>
     55                        <div id="author-info">
     56                                <div id="author-avatar">
     57                                        <?php echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'twentytwelve_author_bio_avatar_size', 68 ) ); ?>
     58                                </div><!-- #author-avatar -->
     59                                <div id="author-description">
     60                                        <h2><?php printf( __( 'About %s', 'twentytwelve' ), get_the_author() ); ?></h2>
     61                                        <?php the_author_meta( 'description' ); ?>
     62                                        <div id="author-link">
     63                                                <a href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>" rel="author">
     64                                                        <?php printf( __( 'View all posts by %s <span class="meta-nav">&rarr;</span>', 'twentytwelve' ), get_the_author() ); ?>
     65                                                </a>
     66                                        </div><!-- #author-link -->
     67                                </div><!-- #author-description -->
     68                        </div><!-- #entry-author-info -->
     69                        <?php endif; ?>
     70                </footer><!-- .entry-meta -->
     71        </article><!-- #post -->
  • trunk/wp-content/themes/twentytwelve/content.php

    r19842 r19915  
    11<?php
    22/**
    3  * The default template for displaying content
     3 * The default template for displaying content on indexed pages (home, archive, search)
    44 *
    55 * @package WordPress
    … …  
    1111        <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    1212                <header class="entry-header">
    13                         <?php if ( is_sticky() ) : ?>
    14                                 <hgroup>
    15                                         <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentytwelve' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
    16                                         <h3 class="entry-format"><?php _e( 'Featured', 'twentytwelve' ); ?></h3>
    17                                 </hgroup>
    18                         <?php else : ?>
    1913                        <h1 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentytwelve' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h1>
    20                         <?php endif; ?>
    2114
    22                         <?php if ( 'post' == get_post_type() ) : ?>
     15                        <?php if ( 'post' == get_post_type() ) : // Hide entry meta for pages ?>
    2316                        <div class="entry-meta">
    2417                                <?php twentytwelve_posted_on(); ?>
    … …  
    2720                </header><!-- .entry-header -->
    2821
    29                 <?php if ( is_search() ) : // Only display Excerpts for Search ?>
     22                <?php if ( is_search() ) : // Only display excerpts for search ?>
    3023                <div class="entry-summary">
    3124                        <?php the_excerpt(); ?>
    … …  
    3932
    4033                <footer class="entry-meta">
    41                         <?php $show_sep = false; ?>
    42                         <?php if ( 'post' == get_post_type() ) : // Hide category and tag text for pages on Search ?>
     34                        <?php if ( 'post' == get_post_type() ) : // Hide category and tag text for pages ?>
    4335                        <?php
    4436                                /* translators: used between list items, there is a space after the comma */
    4537                                $categories_list = get_the_category_list( __( ', ', 'twentytwelve' ) );
    46                                 if ( $categories_list ):
     38                                if ( $categories_list ) :
    4739                        ?>
    4840                        <span class="cat-links">
    49                                 <?php printf( __( '<span class="%1$s">Posted in</span> %2$s', 'twentytwelve' ), 'entry-utility-prep entry-utility-prep-cat-links', $categories_list );
    50                                 $show_sep = true; ?>
     41                                <?php printf( __( '<span class="%1$s">Posted in</span> %2$s', 'twentytwelve' ), 'entry-utility-prep entry-utility-prep-cat-links', $categories_list ); ?>
    5142                        </span>
    5243                        <?php endif; // End if categories ?>
    … …  
    5445                                /* translators: used between list items, there is a space after the comma */
    5546                                $tags_list = get_the_tag_list( '', __( ', ', 'twentytwelve' ) );
    56                                 if ( $tags_list ):
    57                                 if ( $show_sep ) : ?>
    58                         <span class="sep"> | </span>
    59                                 <?php endif; // End if $show_sep ?>
     47                                if ( $tags_list ) : ?>
    6048                        <span class="tag-links">
    61                                 <?php printf( __( '<span class="%1$s">Tagged</span> %2$s', 'twentytwelve' ), 'entry-utility-prep entry-utility-prep-tag-links', $tags_list );
    62                                 $show_sep = true; ?>
     49                                <?php printf( __( '<span class="%1$s">Tagged</span> %2$s', 'twentytwelve' ), 'entry-utility-prep entry-utility-prep-tag-links', $tags_list ); ?>
    6350                        </span>
    6451                        <?php endif; // End if $tags_list ?>
    … …  
    6653
    6754                        <?php if ( comments_open() ) : ?>
    68                         <?php if ( $show_sep ) : ?>
    69                         <span class="sep"> | </span>
    70                         <?php endif; // End if $show_sep ?>
    7155                        <span class="comments-link"><?php comments_popup_link( '<span class="leave-reply">' . __( 'Leave a reply', 'twentytwelve' ) . '</span>', __( '<b>1</b> Reply', 'twentytwelve' ), __( '<b>%</b> Replies', 'twentytwelve' ) ); ?></span>
    7256                        <?php endif; // End if comments_open() ?>
  • trunk/wp-content/themes/twentytwelve/functions.php

    r19845 r19915  
    3737add_action( 'after_setup_theme', 'twentytwelve_setup' );
    3838
    39 if ( ! function_exists( 'twentytwelve_setup' ) ):
     39if ( ! function_exists( 'twentytwelve_setup' ) ) :
    4040/**
    4141 * Sets up theme defaults and registers support for various WordPress features.
    … …  
    6060        add_theme_support( 'automatic-feed-links' );
    6161
     62        // Add support for a variety of post formats
     63        add_theme_support( 'post-formats', array( 'aside', 'image', 'link', 'quote' ) );
     64
    6265        // This theme uses wp_nav_menu() in one location.
    6366        register_nav_menu( 'primary', __( 'Primary Menu', 'twentytwelve' ) );
    6467
    65         // Add support for custom backgrounds
     68        // Add support for custom background.
    6669        add_custom_background();
    67 }
     70
     71        // Add support for a custom header image.
     72        $header_args = array(
     73                'random-default' => true,
     74                'flex-height' => true,
     75                'suggested-height' => apply_filters( 'twentytwelve_header_image_height', 250 ),
     76                'flex-width' => true,
     77                'max-width' => apply_filters( 'twentytwelve_header_image_max_width', 2000 ),
     78                'suggested-width' => apply_filters( 'twentytwelve_header_image_width', 960 ),
     79        );
     80        add_theme_support( 'custom-header', $header_args );
     81        add_custom_image_header( 'twentytwelve_header_style', 'twentytwelve_admin_header_style', 'twentytwelve_admin_header_image' );
     82
     83        // The default header text color
     84        define( 'HEADER_TEXTCOLOR', '444' );
     85}
     86endif;
     87
     88if ( ! function_exists( 'twentytwelve_header_style' ) ) :
     89/**
     90 * Styles the header image and text displayed on the blog
     91 *
     92 * get_header_textcolor() options: HEADER_TEXTCOLOR is default, hide text (returns 'blank'), or any hex value
     93 *
     94 * @since Twenty Twelve 1.0
     95 */
     96function twentytwelve_header_style() {
     97        // If no custom options for text are set, let's bail
     98        if ( HEADER_TEXTCOLOR == get_header_textcolor() )
     99                return;
     100        // If we get this far, we have custom styles.
     101        ?>
     102        <style type="text/css">
     103        <?php
     104                // Has the text been hidden?
     105                if ( 'blank' == get_header_textcolor() ) :
     106        ?>
     107                .site-title,
     108                .site-description {
     109                        position: absolute !important;
     110                        clip: rect(1px 1px 1px 1px); /* IE6, IE7 */
     111                        clip: rect(1px, 1px, 1px, 1px);
     112                }
     113        <?php
     114                // If the user has set a custom color for the text, use that.
     115                else :
     116        ?>
     117                .site-title a,
     118                .site-description {
     119                        color: #<?php echo get_header_textcolor(); ?> !important;
     120                }
     121        <?php endif; ?>
     122        </style>
     123        <?php
     124}
     125endif;
     126
     127if ( ! function_exists( 'twentytwelve_admin_header_style' ) ) :
     128/**
     129 * Styles the header image displayed on the Appearance > Header admin panel.
     130 *
     131 * Referenced via add_custom_image_header() in twentytwelve_setup().
     132 *
     133 * @since Twenty Twelve 1.0
     134 */
     135function twentytwelve_admin_header_style() {
     136?>
     137        <style type="text/css">
     138        .appearance_page_custom-header #headimg {
     139                border: none;
     140        }
     141        #headimg h1,
     142        #headimg h2 {
     143                line-height: 1.6;
     144                margin: 0;
     145                padding: 0;
     146        }
     147        #headimg h1 {
     148                font-size: 30px;
     149        }
     150        #headimg h1 a {
     151                text-decoration: none;
     152        }
     153        #headimg h2 {
     154                font: normal 13px/1.8 "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", sans-serif;
     155                margin-bottom: 24px;
     156        }
     157        #headimg img {
     158        }
     159        </style>
     160<?php
     161}
     162endif;
     163
     164if ( ! function_exists( 'twentytwelve_admin_header_image' ) ) :
     165/**
     166 * Custom header image markup displayed on the Appearance > Header admin panel.
     167 *
     168 * Referenced via add_custom_image_header() in twentytwelve_setup().
     169 *
     170 * @since Twenty Twelve 1.0
     171 */
     172function twentytwelve_admin_header_image() { ?>
     173        <div id="headimg">
     174                <?php
     175                if ( 'blank' == get_theme_mod( 'header_textcolor', HEADER_TEXTCOLOR ) || '' == get_theme_mod( 'header_textcolor', HEADER_TEXTCOLOR ) )
     176                        $style = ' style="display:none;"';
     177                else
     178                        $style = ' style="color:#' . get_theme_mod( 'header_textcolor', HEADER_TEXTCOLOR ) . ';"';
     179                ?>
     180                <h1><a id="name"<?php echo $style; ?> onclick="return false;" href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php bloginfo( 'name' ); ?></a></h1>
     181                <h2 id="desc"<?php echo $style; ?>><?php bloginfo( 'description' ); ?></h2>
     182                <?php $header_image = get_header_image();
     183                if ( ! empty( $header_image ) ) : ?>
     184                        <img src="<?php echo esc_url( $header_image ); ?>" alt="" />
     185                <?php endif; ?>
     186        </div>
     187<?php }
    68188endif;
    69189
    … …  
    90210                'before_widget' => '<aside id="%1$s" class="widget %2$s">',
    91211                'after_widget' => "</aside>",
    92                 'before_title' => '<h3 class="widget-title">',
     212                'before_title' => '<h3 class="widget-title all-caps-title">',
    93213                'after_title' => '</h3>',
    94214        ) );
    … …  
    108228                <nav id="<?php echo $nav_id; ?>">
    109229                        <h3 class="assistive-text"><?php _e( 'Post navigation', 'twentytwelve' ); ?></h3>
    110                         <div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">&larr;</span> Older posts', 'twentytwelve' ) ); ?></div>
    111                         <div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">&rarr;</span>', 'twentytwelve' ) ); ?></div>
     230                        <div class="nav-previous alignleft"><?php next_posts_link( __( '<span class="meta-nav">&larr;</span> Older posts', 'twentytwelve' ) ); ?></div>
     231                        <div class="nav-next alignright"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">&rarr;</span>', 'twentytwelve' ) ); ?></div>
    112232                </nav><!-- #nav-above -->
    113233        <?php endif;
    … …  
    203323}
    204324endif;
     325
     326/**
     327 * Extends the default WordPress body class to denote a full-width layout.
     328 *
     329 * Used in two cases: no active widgets in sidebar, and full-width page template.
     330 *
     331 * @since Twenty Twelve 1.0
     332 */
     333function twentytwelve_body_class( $classes ) {
     334        if ( ! is_active_sidebar( 'sidebar-1' ) || is_page_template( 'full-width' ) )
     335                $classes[] = 'full-width';
     336
     337        return $classes;
     338}
     339add_filter( 'body_class', 'twentytwelve_body_class' );
  • trunk/wp-content/themes/twentytwelve/header.php

    r19845 r19915  
    1414<meta charset="<?php bloginfo( 'charset' ); ?>" />
    1515<meta name="viewport" content="width=device-width" />
    16 <title><?php wp_title( '|', true, 'right' ); ?></title>
     16<title><?php wp_title( '|', true, 'right' ); ?> <?php bloginfo( 'name' ); ?></title>
    1717<link rel="profile" href="http://gmpg.org/xfn/11" />
    1818<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
    … …  
    2828        wp_enqueue_script( 'comment-reply' );
    2929
    30 wp_enqueue_style( 'twentytwelve-style', get_bloginfo( 'stylesheet_url' ) );
     30wp_enqueue_style( 'twentytwelve-style', get_stylesheet_uri() );
    3131?>
    3232<?php wp_head(); ?>
    … …  
    4747                        <?php wp_nav_menu( array( 'theme_location' => 'primary' ) ); ?>
    4848                </nav>
     49
     50                <?php $header_image = get_header_image();
     51                if ( ! empty( $header_image ) ) : ?>
     52                        <img src="<?php echo esc_url( $header_image ); ?>" alt="" />
     53                <?php endif; ?>
    4954        </header><!-- #masthead -->
    5055
  • trunk/wp-content/themes/twentytwelve/index.php

    r19842 r19915  
    1717        <div id="primary">
    1818                <div id="content" role="main">
    19                 <!-- Placeholder for optional header image
    20                 <section role="banner">
    21                         <img src="<?php echo get_stylesheet_directory_uri(); ?>/images/flowers.jpg" width="625" height="188" />
    22                 </section>
    23                 -->
    2419                <?php if ( have_posts() ) : ?>
    2520
  • trunk/wp-content/themes/twentytwelve/sidebar.php

    r19842 r19915  
    22/**
    33 * The Sidebar containing the main widget area.
     4 *
     5 * If no active widgets in sidebar, hide it completely.
    46 *
    57 * @package WordPress
    … …  
    810 */
    911?>
     12
     13        <?php if ( is_active_sidebar( 'sidebar-1' ) ) : ?>
    1014        <div id="secondary" class="widget-area" role="complementary">
    11                 <?php if ( ! dynamic_sidebar( 'sidebar-1' ) ) : ?>
    12 
    13                         <aside id="archives" class="widget">
    14                                 <h3 class="widget-title"><?php _e( 'Archives', 'twentytwelve' ); ?></h3>
    15                                 <ul>
    16                                         <?php wp_get_archives( array( 'type' => 'monthly' ) ); ?>
    17                                 </ul>
    18                         </aside>
    19 
    20                         <aside id="meta" class="widget">
    21                                 <h3 class="widget-title"><?php _e( 'Meta', 'twentytwelve' ); ?></h3>
    22                                 <ul>
    23                                         <?php wp_register(); ?>
    24                                         <li><?php wp_loginout(); ?></li>
    25                                         <?php wp_meta(); ?>
    26                                 </ul>
    27                         </aside>
    28 
    29                 <?php endif; // end sidebar widget area ?>
     15                <?php dynamic_sidebar( 'sidebar-1' ); ?>
    3016        </div><!-- #secondary .widget-area -->
     17        <?php endif; ?>
  • trunk/wp-content/themes/twentytwelve/style.css

    r19842 r19915  
    115115}
    116116
     117/* patterns.scss
     118 * Repeatable patterns
     119 * ------------------------------------------------------------------ */
     120.all-caps-title {
     121        text-transform: uppercase;
     122        font-weight: 400;
     123        font-size: 13px;
     124        font-size: 0.928571429rem;
     125        line-height: 1.846153846;
     126}
     127
    117128/* scaffolding.css.scss
    118129* Basic structure
    … …  
    149160Page structure
    150161------------------------------------------------------------ */
    151 div#page {
     162#page {
    152163        padding: 0 24px;
    153164        padding: 0 1.714285714rem;
    … …  
    155166}
    156167@media screen and (min-width: 600px) {
    157         div#page {
     168        #page {
    158169                zoom: 1;
    159170                margin: 0 auto;
    … …  
    161172                max-width: 68.571428571rem;
    162173        }
    163         div#page:before, div#page:after {
     174        #page:before, #page:after {
    164175                display: table;
    165176                content: "";
    166177        }
    167         div#page:after {
     178        #page:after {
    168179                clear: both;
    169180        }
    … …  
    171182}
    172183
    173 div#primary {
     184#primary {
    174185        margin: 24px 0;
    175186        margin: 1.714285714rem 0;
    176187}
    177188@media screen and (min-width: 600px) {
    178         div#primary {
     189        #primary {
    179190                float: left;
    180191                width: 65.104166667%;
    181192        }
    182193
    183 }
    184 
    185 div#secondary {
     194@media screen and (min-width: 600px) {
     195        body.full-width #primary {
     196                width: 100%;
     197        }
     198}
     199
     200#secondary {
    186201        margin: 24px 0;
    187202        margin: 1.714285714rem 0;
    188203}
    189204@media screen and (min-width: 600px) {
    190         div#secondary {
     205        #secondary {
    191206                float: right;
    192207                width: 26.041666667%;
    … …  
    348363        margin-bottom: 24px;
    349364        margin-bottom: 1.714285714rem;
    350         text-transform: uppercase;
    351         font-weight: 300;
    352         font-size: 13px;
    353         font-size: 0.928571429rem;
    354         line-height: 1.846153846;
    355365}
    356366div#secondary aside p,
    … …  
    522532        max-width: 100%;
    523533}
     534
     535/* archive.css.scss
     536 * Styling for the archive view
     537 * ------------------------------------------------------------------ */
     538#content.archive h1.archive-title {
     539        margin-bottom: 48px;
     540        margin-bottom: 3.428571429rem;
     541        padding-bottom: 22px;
     542        padding-bottom: 1.571428571rem;
     543        border-bottom: 1px solid #ededed;
     544        color: #777777;
     545}
Note: See TracChangeset for help on using the changeset viewer.