WordPress.org

Make WordPress Core

Changeset 25090


Ignore:
Timestamp:
08/22/2013 06:05:56 PM (8 years ago)
Author:
lancewillett
Message:

Twenty Fourteen: widgetize the Post Format front page so other widgets can be used there, and the special Post Format content can be used in other widget areas. Props obenland, see #25028.

Location:
trunk/src/wp-content/themes/twentyfourteen
Files:
2 added
1 deleted
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentyfourteen/front-page.php

    r25088 r25090  
    3939                </div><!-- #primary .content-area -->
    4040
    41                 <?php get_template_part( 'recent-formatted-posts' ); ?>
     41                <?php get_sidebar( 'ephemera' ); ?>
    4242
    4343            </div><!-- .front-page-content-area -->
  • trunk/src/wp-content/themes/twentyfourteen/functions.php

    r25087 r25090  
    132132 */
    133133function twentyfourteen_widgets_init() {
     134    require get_template_directory() . '/inc/widgets.php';
     135    register_widget( 'Twenty_Fourteen_Ephemera_Widget' );
     136
    134137    register_sidebar( array(
    135         'name' => __( 'Primary Sidebar', 'twentyfourteen' ),
    136         'id' => 'sidebar-1',
    137         'description' => __( 'Main sidebar that appears on the left.', 'twentyfourteen' ),
     138        'name'          => __( 'Primary Sidebar', 'twentyfourteen' ),
     139        'id'            => 'sidebar-1',
     140        'description'   => __( 'Main sidebar that appears on the left.', 'twentyfourteen' ),
    138141        'before_widget' => '<aside id="%1$s" class="widget %2$s">',
    139         'after_widget' => '</aside>',
    140         'before_title' => '<h1 class="widget-title">',
    141         'after_title' => '</h1>',
     142        'after_widget'  => '</aside>',
     143        'before_title'  => '<h1 class="widget-title">',
     144        'after_title'   => '</h1>',
    142145    ) );
    143146    register_sidebar( array(
    144         'name' => __( 'Content Sidebar', 'twentyfourteen' ),
    145         'id' => 'sidebar-2',
    146         'description' => __( 'Additional sidebar that appears on the right, on single posts and pages.', 'twentyfourteen' ),
     147        'name'          => __( 'Front Page Sidebar', 'twentyfourteen' ),
     148        'id'            => 'sidebar-2',
     149        'description'   => __( 'Additional sidebar that appears on the right, on the home page.', 'twentyfourteen' ),
    147150        'before_widget' => '<aside id="%1$s" class="widget %2$s">',
    148         'after_widget' => '</aside>',
    149         'before_title' => '<h1 class="widget-title">',
    150         'after_title' => '</h1>',
     151        'after_widget'  => '</aside>',
     152        'before_title'  => '<h1 class="widget-title">',
     153        'after_title'   => '</h1>',
    151154    ) );
    152155    register_sidebar( array(
    153         'name' => __( 'Footer Widget Area', 'twentyfourteen' ),
    154         'id' => 'sidebar-3',
     156        'name'          => __( 'Content Sidebar', 'twentyfourteen' ),
     157        'id'            => 'sidebar-3',
     158        'description'   => __( 'Additional sidebar that appears on the right, on single posts and pages.', 'twentyfourteen' ),
    155159        'before_widget' => '<aside id="%1$s" class="widget %2$s">',
    156         'after_widget' => '</aside>',
    157         'before_title' => '<h1 class="widget-title">',
    158         'after_title' => '</h1>',
     160        'after_widget'  => '</aside>',
     161        'before_title'  => '<h1 class="widget-title">',
     162        'after_title'   => '</h1>',
     163    ) );
     164    register_sidebar( array(
     165        'name'          => __( 'Footer Widget Area', 'twentyfourteen' ),
     166        'id'            => 'sidebar-4',
     167        'description'   => __( 'Appears in the footer section of the site.', 'twentyfourteen' ),
     168        'before_widget' => '<aside id="%1$s" class="widget %2$s">',
     169        'after_widget'  => '</aside>',
     170        'before_title'  => '<h1 class="widget-title">',
     171        'after_title'   => '</h1>',
    159172    ) );
    160173}
  • trunk/src/wp-content/themes/twentyfourteen/rtl.css

    r25060 r25090  
    220220----------------------------------------------- */
    221221
    222 .format-title:before {
     222.ephemera .widget-title:before {
    223223    margin-left: 10px;
    224224    margin-left: 1.0rem;
  • trunk/src/wp-content/themes/twentyfourteen/sidebar-content.php

    r25060 r25090  
    1010    <?php do_action( 'before_sidebar' ); ?>
    1111
    12     <?php if ( ! dynamic_sidebar( 'sidebar-2' ) ) : ?>
     12    <?php if ( ! dynamic_sidebar( 'sidebar-3' ) ) : ?>
    1313        <aside id="search" class="widget widget_search">
    1414                <?php get_search_form(); ?>
  • trunk/src/wp-content/themes/twentyfourteen/sidebar-footer.php

    r25065 r25090  
    66 * @subpackage Twenty_Fourteen
    77 */
    8 ?>
    9 <?php
    10 if (   ! is_active_sidebar( 'sidebar-3' ) )
     8
     9if ( ! is_active_sidebar( 'sidebar-4' ) )
    1110    return;
    1211?>
     12
    1313<div id="supplementary">
    14 
    15     <?php if ( is_active_sidebar( 'sidebar-3' ) ) : ?>
    1614    <div id="footer-sidebar" class="widget-area" role="complementary">
    17         <?php dynamic_sidebar( 'sidebar-3' ); ?>
     15        <?php dynamic_sidebar( 'sidebar-4' ); ?>
    1816    </div><!-- #footer-sidebar -->
    19     <?php endif; ?>
    20 
    2117</div><!-- #supplementary -->
  • trunk/src/wp-content/themes/twentyfourteen/style.css

    r25089 r25090  
    429429.site a,
    430430.more-link .meta-nav,
    431 .more-formatted-posts-link .meta-nav,
     431.post-format-archive-link .meta-nav,
    432432.attachment-featured-featured img,
    433433.attachment-featured-thumbnail img,
     
    10291029    display: inline;
    10301030}
    1031 .post-formatted-posts .entry-title:after,
     1031.ephemera .entry-title:after,
    10321032.content-area span + .entry-date:before,
    10331033span + .byline:before,
     
    11831183}
    11841184.more-link,
    1185 .more-formatted-posts-link {
     1185.post-format-archive-link {
    11861186    font-size: 14px;
    11871187    font-size: 1.4rem;
     
    11901190}
    11911191.more-link:hover,
    1192 .more-formatted-posts-link:hover {
     1192.post-format-archive-link:hover {
    11931193    text-decoration: none;
    11941194}
    11951195.more-link .meta-nav,
    1196 .more-formatted-posts-link .meta-nav {
     1196.post-format-archive-link .meta-nav {
    11971197    position: relative;
    11981198    left: 0;
    11991199}
    12001200.more-link:hover .meta-nav,
    1201 .more-formatted-posts-link:hover .meta-nav {
     1201.post-format-archive-link:hover .meta-nav {
    12021202    left: 5px;
    12031203    left: 0.5rem;
     
    14311431----------------------------------------------- */
    14321432
    1433 .post-formatted-posts {
     1433.ephemera {
    14341434    border-top: 1px solid rgba(0, 0, 0, 0.1);
    14351435    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
     
    14401440    padding: 2.3rem 1.0rem 0;
    14411441}
    1442 .post-formatted-posts .format-title {
     1442.ephemera .widget-title {
    14431443    border-top: 5px solid #000;
    14441444    color: #2b2b2b;
     
    14521452    text-transform: uppercase;
    14531453}
    1454 .post-formatted-posts .entry-content a {
     1454.ephemera .entry-content a {
    14551455    word-wrap: break-word;
    14561456}
    1457 .format-title:before {
     1457.ephemera .widget-title:before {
    14581458    background-color: #000;
    14591459    color: #fff;
     
    14681468    width: 3.6rem;
    14691469}
    1470 .recent-videos .format-title:before {
     1470.ephemera .video.widget-title:before {
    14711471    content: '\F104';
    14721472}
    1473 .recent-images .format-title:before {
     1473.ephemera .image.widget-title:before {
    14741474    content: '\F102';
    14751475}
    1476 .recent-galleries .format-title:before {
     1476.ephemera .gallery.widget-title:before {
    14771477    content: '\F103';
    14781478}
    1479 .recent-asides .format-title:before {
     1479.ephemera .aside.widget-title:before {
    14801480    content: '\F101';
    14811481}
    1482 .recent-quotes .format-title:before {
     1482.ephemera .quote.widget-title:before {
    14831483    content: '\F106';
    14841484}
    1485 .recent-links .format-title:before {
     1485.ephemera .link.widget-title:before {
    14861486    content: '\F107';
    14871487}
    1488 .post-formatted-posts .hentry {
     1488.ephemera .hentry {
    14891489    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    14901490    margin-bottom: 18px;
    14911491    margin-bottom: 1.8rem;
    14921492}
    1493 .post-formatted-posts .hentry:last-of-type {
     1493.ephemera .hentry:last-of-type {
    14941494    margin-bottom: 9px;
    14951495    margin-bottom: 0.9rem;
    14961496}
    1497 .post-formatted-posts .entry-title {
     1497.ephemera .entry-title {
    14981498    display: inline;
    14991499    font-size: 12px;
     
    15041504    margin: 0 0 0.6rem 0;
    15051505}
    1506 .post-formatted-posts .entry-meta {
     1506.ephemera .entry-meta {
    15071507    color: rgba(0, 0, 0, 0.2);
    15081508    line-height: 1.5;
     
    15101510    margin-bottom: 1.8rem;
    15111511}
    1512 .post-formatted-posts .entry-meta a {
     1512.ephemera .entry-meta a {
    15131513    color: #767676;
    15141514}
    1515 .post-formatted-posts .entry-meta a:hover {
     1515.ephemera .entry-meta a:hover {
    15161516    color: #2b2b2b;
    15171517}
    1518 .post-formatted-posts .entry-content p:not(.wp-caption-text) {
     1518.ephemera .entry-content p:not(.wp-caption-text) {
    15191519    font-size: 13px;
    15201520    font-size: 1.3rem;
     
    15231523    margin-bottom: 1.8rem;
    15241524}
    1525 .post-formatted-posts .entry-content blockquote p cite {
     1525.ephemera .entry-content blockquote p cite {
    15261526    font-size: 13px;
    15271527    font-size: 1.3rem;
    15281528    line-height: 1.3846153846;
    15291529}
    1530 .post-formatted-posts .wp-caption {
     1530.ephemera .wp-caption {
    15311531    margin-bottom: 18px;
    15321532    margin-bottom: 1.8rem;
    15331533}
    1534 .post-formatted-posts .wp-caption-text {
     1534.ephemera .wp-caption-text {
    15351535    line-height: 1.5;
    15361536    margin: 6px 0 0;
     
    15381538    padding: 0;
    15391539}
    1540 .post-formatted-posts .format-gallery .wp-caption-text {
     1540.ephemera .format-gallery .wp-caption-text {
    15411541    margin-bottom: 18px;
    15421542    margin-bottom: 1.8rem;
    15431543}
    1544 .post-formatted-posts .more-link {
     1544.ephemera .more-link {
    15451545    font-size: 12px;
    15461546    font-size: 1.2rem;
    15471547    line-height: 1.5;
    15481548}
    1549 .post-formatted-posts .more-formatted-posts-link {
     1549.ephemera .post-format-archive-link {
    15501550    display: inline-block;
    15511551    font-size: 12px;
     
    21072107    margin-left: 0.1rem;
    21082108}
    2109 .widget div:last-child,
    21102109.widget table:last-child,
    21112110.widget iframe:last-child,
     
    25192518        width: 30.35714285%;
    25202519    }
    2521     .post-formatted-posts {
     2520    .ephemera {
    25222521        border: none;
    25232522        clear: none;
     
    28242823    }
    28252824    .content-sidebar,
    2826     .post-formatted-posts {
     2825    .ephemera {
    28272826        margin: 0 0 0 -27.31707317%;
    28282827        width: 24.87804878%;
     
    30563055    }
    30573056    .content-sidebar,
    3058     .post-formatted-posts {
     3057    .ephemera {
    30593058        padding-right: 0;
    30603059    }
Note: See TracChangeset for help on using the changeset viewer.