Make WordPress Core

Ticket #21255: 21255.2.diff

File 21255.2.diff, 4.1 KB (added by obenland, 11 years ago)

Proposed handling of archive descriptions

  • wp-content/themes/twentytwelve/style.css

     
    972972/* =Styling for the archive view
    973973-------------------------------------------------------------- */
    974974
    975 .archive #content .archive-title,
     975.archive #content .archive-header,
    976976.search .page-header {
    977977        margin-bottom: 48px;
    978978        margin-bottom: 3.428571429rem;
     
    981981        border-bottom: 1px solid #ededed;
    982982}
    983983
     984.category-archive-meta,
     985.tag-archive-meta  {
     986        font-size: 11px;
     987        font-size: 0.785714286rem;
     988        line-height: 2.181818182;
     989        text-transform: uppercase;
     990        color: #636363;
     991        margin-top: 22px;
     992        margin-top: 1.571428571rem;
     993}
    984994
    985995/* =Styling for the single image attachment view
    986996-------------------------------------------------------------- */
  • wp-content/themes/twentytwelve/archive.php

     
    1818                <div id="content" role="main">
    1919
    2020                <?php if ( have_posts() ) : ?>
    21                         <h1 class="archive-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 '<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 '<div class="category-archive-meta">' . $category_description . '</div>';
    40                                 } else {
    41                                         _e( 'Blog Archives', 'twentytwelve' );
    42                                 }
    43                         ?></h1>
    44 
     21                        <header class="archive-header">
     22                                <h1 class="archive-title"><?php
     23                                        if ( is_day() ) {
     24                                                printf( __( 'Daily Archives: %s', 'twentytwelve' ), '<span>' . get_the_date() . '</span>' );
     25                                        } elseif ( is_month() ) {
     26                                                printf( __( 'Monthly Archives: %s', 'twentytwelve' ), '<span>' . get_the_date( _x( 'F Y', 'monthly archives date format', 'twentytwelve' ) ) . '</span>' );
     27                                        } elseif ( is_year() ) {
     28                                                printf( __( 'Yearly Archives: %s', 'twentytwelve' ), '<span>' . get_the_date( _x( 'Y', 'yearly archives date format', 'twentytwelve' ) ) . '</span>' );
     29                                        } elseif ( is_tag() ) {
     30                                                printf( __( 'Tag Archives: %s', 'twentytwelve' ), '<span>' . single_tag_title( '', false ) . '</span>' );       
     31                                        } elseif ( is_category() ) {
     32                                                printf( __( 'Category Archives: %s', 'twentytwelve' ), '<span>' . single_cat_title( '', false ) . '</span>' );
     33                                        } else {
     34                                                _e( 'Blog Archives', 'twentytwelve' );
     35                                        }
     36                                ?></h1>
     37       
     38                                <?php                   
     39                                        if ( is_tag() ) {
     40                                                // Show an optional tag description
     41                                                $tag_description = tag_description();
     42                                                if ( $tag_description )
     43                                                        echo '<div class="tag-archive-meta">' . $tag_description . '</div>';
     44                                        }
     45                                       
     46                                        if ( is_category() ) {
     47                                                // Show an optional category description
     48                                                $category_description = category_description();
     49                                                if ( $category_description )
     50                                                        echo '<div class="category-archive-meta">' . $category_description . '</div>';
     51                                        }
     52                                ?>
     53                        </header>
     54                       
    4555                        <?php
    4656                        /* Start the Loop */
    4757                        while ( have_posts() ) : the_post();