Make WordPress Core

Ticket #25028: 25028.diff

File 25028.diff, 28.2 KB (added by obenland, 12 years ago)
  • wp-content/themes/twentyfourteen/ephemera.php

     
    77 */
    88?>
    99
    10 <div class="post-formatted-posts">
    11 <?php
    12         do_action( 'before_sidebar' );
    13         do_action( 'twentyfourteen_formatted_posts_before' );
    14         $recent_videos = twentyfourteen_get_recent( 'post-format-video' );
    15         if ( $recent_videos->have_posts() ) :
    16 ?>
    17         <section id="recent-videos" class="recent-videos">
    18                 <h1 class="format-title genericon">
    19                         <a class="entry-format" href="<?php echo esc_url( get_post_format_link( 'video' ) ); ?>" title="<?php esc_attr_e( 'All Video Posts', 'twentyfourteen' ); ?>"><?php _e( 'Videos', 'twentyfourteen' ); ?></a>
    20                 </h1>
    21                 <?php
    22                         while ( $recent_videos->have_posts() ) : $recent_videos->the_post();
    23                                 get_template_part( 'content', 'recent-formatted-post' );
    24                         endwhile;
    25                 ?>
    26                 <a class="more-formatted-posts-link" href="<?php echo esc_url( get_post_format_link( 'video' ) ); ?>" title="<?php esc_attr_e( 'More Videos', 'twentyfourteen' ); ?>"><?php _e( 'More Videos <span class="meta-nav">&rarr;</span>', 'twentyfourteen' ); ?></a>
    27         </section>
    28 <?php endif; ?>
    29 
    30 <?php
    31         $recent_images = twentyfourteen_get_recent( 'post-format-image' );
    32         if ( $recent_images->have_posts() ) :
    33 ?>
    34         <section id="recent-images" class="recent-images">
    35                 <h1 class="format-title genericon">
    36                         <a class="entry-format" href="<?php echo esc_url( get_post_format_link( 'image' ) ); ?>" title="<?php esc_attr_e( 'All Image Posts', 'twentyfourteen' ); ?>"><?php _e( 'Images', 'twentyfourteen' ); ?></a>
    37                 </h1>
    38                 <?php
    39                         while ( $recent_images->have_posts() ) : $recent_images->the_post();
    40                                 get_template_part( 'content', 'recent-formatted-post' );
    41                         endwhile;
    42                 ?>
    43                 <a class="more-formatted-posts-link" href="<?php echo esc_url( get_post_format_link( 'image' ) ); ?>" title="<?php esc_attr_e( 'More images', 'twentyfourteen' ); ?>"><?php _e( 'More images <span class="meta-nav">&rarr;</span>', 'twentyfourteen' ); ?></a>
    44         </section>
    45 <?php endif; ?>
    46 
    47 <?php
    48         $recent_galleries = twentyfourteen_get_recent( 'post-format-gallery' );
    49         if ( $recent_galleries->have_posts() ) :
    50 ?>
    51         <section id="recent-galleries" class="recent-galleries">
    52                 <h1 class="format-title genericon">
    53                         <a class="entry-format" href="<?php echo esc_url( get_post_format_link( 'gallery' ) ); ?>" title="<?php esc_attr_e( 'All Gallery Posts', 'twentyfourteen' ); ?>"><?php _e( 'Galleries', 'twentyfourteen' ); ?></a>
    54                 </h1>
    55                 <?php
    56                         while ( $recent_galleries->have_posts() ) : $recent_galleries->the_post();
    57                                 get_template_part( 'content', 'recent-formatted-post' );
    58                         endwhile;
    59                 ?>
    60                 <a class="more-formatted-posts-link" href="<?php echo esc_url( get_post_format_link( 'gallery' ) ); ?>" title="<?php esc_attr_e( 'More Galleries', 'twentyfourteen' ); ?>"><?php _e( 'More galleries <span class="meta-nav">&rarr;</span>', 'twentyfourteen' ); ?></a>
    61         </section>
    62 <?php endif; ?>
    63 
    64 <?php
    65         $recent_asides = twentyfourteen_get_recent( 'post-format-aside' );
    66         if ( $recent_asides->have_posts() ) :
    67 ?>
    68         <section id="recent-asides" class="recent-asides">
    69                 <h1 class="format-title genericon">
    70                         <a class="entry-format" href="<?php echo esc_url( get_post_format_link( 'aside' ) ); ?>" title="<?php esc_attr_e( 'All Aside Posts', 'twentyfourteen' ); ?>"><?php _e( 'Asides', 'twentyfourteen' ); ?></a>
    71                 </h1>
    72                 <?php
    73                         while ( $recent_asides->have_posts() ) : $recent_asides->the_post();
    74                                 get_template_part( 'content', 'recent-formatted-post' );
    75                         endwhile;
    76                 ?>
    77                 <a class="more-formatted-posts-link" href="<?php echo esc_url( get_post_format_link( 'aside' ) ); ?>" title="<?php esc_attr_e( 'More Asides', 'twentyfourteen' ); ?>"><?php _e( 'More asides <span class="meta-nav">&rarr;</span>', 'twentyfourteen' ); ?></a>
    78         </section>
    79 <?php endif; ?>
    80 
    81 <?php
    82         $recent_links = twentyfourteen_get_recent( 'post-format-link' );
    83         if ( $recent_links->have_posts() ) :
    84 ?>
    85         <section id="recent-links" class="recent-links">
    86                 <h1 class="format-title genericon">
    87                         <a class="entry-format" href="<?php echo esc_url( get_post_format_link( 'link' ) ); ?>" title="<?php esc_attr_e( 'All Link Posts', 'twentyfourteen' ); ?>"><?php _e( 'Links', 'twentyfourteen' ); ?></a>
    88                 </h1>
    89                 <?php
    90                         while ( $recent_links->have_posts() ) : $recent_links->the_post();
    91                                 get_template_part( 'content', 'recent-formatted-post' );
    92                         endwhile;
    93                 ?>
    94                 <a class="more-formatted-posts-link" href="<?php echo esc_url( get_post_format_link( 'link' ) ); ?>" title="<?php esc_attr_e( 'More Links', 'twentyfourteen' ); ?>"><?php _e( 'More links <span class="meta-nav">&rarr;</span>', 'twentyfourteen' ); ?></a>
    95         </section>
    96 <?php endif; ?>
    97 
    98 <?php
    99         $recent_quotes = twentyfourteen_get_recent( 'post-format-quote' );
    100         if ( $recent_quotes->have_posts() ) :
     10<div id="ephemera" class="ephemera" role="complementary">
     11<?php $i =1;
     12        foreach ( array( 'video', 'image', 'gallery', 'aside', 'link', 'quote' ) as $format ) :
     13                the_widget(
     14                        'Twenty_Fourteen_Ephemera_Widget',
     15                        array(
     16                                'format' => $format,
     17                                'number' => ++$i,
     18                        ),
     19                        array(
     20                                'before_widget' => '<aside class="widget widget_twentyfourteen_ephemera">',
     21                                'after_widget'  => '</aside>',
     22                        )
     23                );
     24        endforeach;
    10125?>
    102         <section id="recent-quotes" class="recent-quotes">
    103                 <h1 class="format-title genericon">
    104                         <a class="entry-format" href="<?php echo esc_url( get_post_format_link( 'quote' ) ); ?>" title="<?php esc_attr_e( 'All Quote Posts', 'twentyfourteen' ); ?>"><?php _e( 'Quotes', 'twentyfourteen' ); ?></a>
    105                 </h1>
    106                 <?php
    107                         while ( $recent_quotes->have_posts() ) : $recent_quotes->the_post();
    108                                 get_template_part( 'content', 'recent-formatted-post' );
    109                         endwhile;
    110                 ?>
    111                 <a class="more-formatted-posts-link" href="<?php echo esc_url( get_post_format_link( 'quote' ) ); ?>" title="<?php esc_attr_e( 'More Quotes', 'twentyfourteen' ); ?>"><?php _e( 'More quotes <span class="meta-nav">&rarr;</span>', 'twentyfourteen' ); ?></a>
    112         </section>
    113 <?php endif; ?>
    114 
    115 <?php
    116         wp_reset_postdata();
    117         do_action( 'twentyfourteen_formatted_posts_after' );
    118 ?>
    119 
    120 </div>
    121  No newline at end of file
     26</div>
  • wp-content/themes/twentyfourteen/functions.php

     
    123123 * @return void
    124124 */
    125125function twentyfourteen_widgets_init() {
     126        require get_template_directory() . '/inc/widgets.php';
     127        register_widget( 'Twenty_Fourteen_Ephemera_Widget' );
     128
    126129        register_sidebar( array(
    127130                'name' => __( 'Primary Sidebar', 'twentyfourteen' ),
    128131                'id' => 'sidebar-1',
     
    377380}
    378381
    379382/**
    380  * Gets recent formatted posts that are not featured in FC plugin.
    381  *
    382  */
    383 function twentyfourteen_get_recent( $post_format ) {
    384         $args = array(
    385                 'order' => 'DESC',
    386                 'ignore_sticky_posts' => 1,
    387                 'posts_per_page' => 2,
    388                 'tax_query' => array(
    389                         array(
    390                                 'taxonomy' => 'post_format',
    391                                 'terms' => array( $post_format ),
    392                                 'field' => 'slug',
    393                                 'operator' => 'IN',
    394                         ),
    395                 ),
    396                 'no_found_rows' => true,
    397         );
    398 
    399         $featured_posts = twentyfourteen_get_featured_posts();
    400 
    401         if ( is_array( $featured_posts ) && ! empty( $featured_posts ) )
    402                 $args['post__not_in'] = wp_list_pluck( $featured_posts, 'ID' );
    403 
    404         return new WP_Query( $args );
    405 }
    406 
    407 /**
    408  * Filter the home page posts, and remove formatted posts visible in the sidebar from it
    409  *
    410  */
    411 function twentyfourteen_pre_get_posts( $query ) {
    412         // Bail if not home, not a query, not main query.
    413         if ( ! $query->is_main_query() || is_admin() )
    414                 return;
    415 
    416         // Only on the home page
    417         if ( $query->is_home() ) {
    418                 $exclude_ids = array();
    419 
    420                 $videos = twentyfourteen_get_recent( 'post-format-video' );
    421                 $images = twentyfourteen_get_recent( 'post-format-image' );
    422                 $galleries = twentyfourteen_get_recent( 'post-format-gallery' );
    423                 $asides = twentyfourteen_get_recent( 'post-format-aside' );
    424                 $links = twentyfourteen_get_recent( 'post-format-link' );
    425                 $quotes = twentyfourteen_get_recent( 'post-format-quote' );
    426 
    427                 foreach ( $videos->posts as $post )
    428                         $exclude_ids[] = $post->ID;
    429 
    430                 foreach ( $images->posts as $post )
    431                         $exclude_ids[] = $post->ID;
    432 
    433                 foreach ( $galleries->posts as $post )
    434                         $exclude_ids[] = $post->ID;
    435 
    436                 foreach ( $asides->posts as $post )
    437                         $exclude_ids[] = $post->ID;
    438 
    439                 foreach ( $links->posts as $post )
    440                         $exclude_ids[] = $post->ID;
    441 
    442                 foreach ( $quotes->posts as $post )
    443                         $exclude_ids[] = $post->ID;
    444 
    445                 $query->set( 'post__not_in', $exclude_ids );
    446         }
    447 }
    448 add_action( 'pre_get_posts', 'twentyfourteen_pre_get_posts' );
    449 
    450 /**
    451383 *  Extends the default WordPress body classes.
    452384 *
    453385 * Adds body classes to denote:
  • wp-content/themes/twentyfourteen/rtl.css

     
    219219/* =Post Formatted posts column
    220220----------------------------------------------- */
    221221
    222 .format-title:before {
     222.ephemera .widget-title:before {
    223223        margin-left: 10px;
    224224        margin-left: 1.0rem;
    225225        margin-right: auto;
  • wp-content/themes/twentyfourteen/inc/widgets.php

     
     1<?php
     2/**
     3 * Makes a custom Widget for displaying Aside, Quote, Video, Image, Gallery,
     4 * and Link posts, available with Twenty Fourteen.
     5 *
     6 * Learn more: http://codex.wordpress.org/Widgets_API#Developing_Widgets
     7 *
     8 * @package WordPress
     9 * @subpackage Twenty_Fourteen
     10 */
     11
     12class Twenty_Fourteen_Ephemera_Widget extends WP_Widget {
     13
     14        /**
     15         * The supported post formats.
     16         *
     17         * @var array
     18         */
     19        private $formats = array( 'aside', 'image', 'video', 'quote', 'link', 'gallery' );
     20
     21        /**
     22         * Pluralized post format strings.
     23         *
     24         * @var array
     25         */
     26        private $format_strings;
     27
     28        /**
     29         * Constructor.
     30         *
     31         * @return Twenty_Fourteen_Ephemera_Widget
     32         */
     33        public function __construct() {
     34                parent::__construct( 'widget_twentyfourteen_ephemera', __( 'Twenty Fourteen Ephemera', 'twentyfourteen' ), array(
     35                        'classname'   => 'widget_twentyfourteen_ephemera',
     36                        'description' => __( 'Use this widget to list your recent Aside, Quote, Video, Image, Gallery, and Link posts', 'twentyfourteen' ),
     37                ) );
     38
     39                $this->format_strings = array(
     40                        'aside'   => __( 'Asides',    'twentyfourteen' ),
     41                        'image'   => __( 'Images',    'twentyfourteen' ),
     42                        'video'   => __( 'Videos',    'twentyfourteen' ),
     43                        'quote'   => __( 'Quotes',    'twentyfourteen' ),
     44                        'link'    => __( 'Links',     'twentyfourteen' ),
     45                        'gallery' => __( 'Galleries', 'twentyfourteen' ),
     46                );
     47
     48                add_action( 'save_post',    array( $this, 'flush_widget_cache' ) );
     49                add_action( 'deleted_post', array( $this, 'flush_widget_cache' ) );
     50                add_action( 'switch_theme', array( $this, 'flush_widget_cache' ) );
     51        }
     52
     53        /**
     54         * Outputs the HTML for this widget.
     55         *
     56         * @param array $args An array of standard parameters for widgets in this theme.
     57         * @param array $instance An array of settings for this widget instance.
     58         * @return void Echoes its output.
     59         */
     60        public function widget( $args, $instance ) {
     61                // If called directly, assign an unique index for caching.
     62                if ( -1 == $this->number ) {
     63                        static $num = -1;
     64                        $this->_set( --$num );
     65                }
     66
     67                $content = get_transient( $this->id );
     68
     69                if ( false !== $content ) {
     70                        echo $content;
     71                        return;
     72                }
     73
     74                ob_start();
     75                extract( $args, EXTR_SKIP );
     76
     77                $format = $instance['format'];
     78                $title  = apply_filters( 'widget_title', empty( $instance['title'] ) ? $this->format_strings[ $format ] : $instance['title'], $instance, $this->id_base );
     79
     80                $ephemera = new WP_Query( array(
     81                        'order'          => 'DESC',
     82                        'posts_per_page' => 2,
     83                        'no_found_rows'  => true,
     84                        'post_status'    => 'publish',
     85                        'post__not_in'   => get_option( 'sticky_posts' ),
     86                        'tax_query'      => array(
     87                                array(
     88                                        'taxonomy' => 'post_format',
     89                                        'terms'    => array( "post-format-$format" ),
     90                                        'field'    => 'slug',
     91                                        'operator' => 'IN',
     92                                ),
     93                        ),
     94                ) );
     95
     96                if ( $ephemera->have_posts() ) :
     97                        $tmp_content_width = $GLOBALS['content_width'];
     98                        $GLOBALS['content_width'] = 306;
     99
     100                        echo $before_widget;
     101                        ?>
     102                        <h1 class="widget-title genericon <?php echo esc_attr( $format ); ?>">
     103                                <a class="entry-format" href="<?php echo esc_url( get_post_format_link( $format ) ); ?>"><?php echo $title; ?></a>
     104                        </h1>
     105                        <ol>
     106
     107                                <?php while ( $ephemera->have_posts() ) : $ephemera->the_post(); ?>
     108                                <li>
     109                                <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
     110                                        <div class="entry-content">
     111                                                <?php
     112                                                        if ( has_post_format( 'gallery' ) ) :
     113                                                                $images = get_posts( array(
     114                                                                        'post_parent'    => get_post()->post_parent,
     115                                                                        'fields'         => 'ids',
     116                                                                        'numberposts'    => -1,
     117                                                                        'post_status'    => 'inherit',
     118                                                                        'post_type'      => 'attachment',
     119                                                                        'post_mime_type' => 'image',
     120                                                                        'order'          => 'ASC',
     121                                                                        'orderby'        => 'menu_order ID'
     122                                                                ) );
     123                                                                $total_images = count( $images );
     124
     125                                                                if ( has_post_thumbnail() ) :
     126                                                                        $featured_image = get_the_post_thumbnail( get_the_ID(), 'featured-thumbnail-formatted' );
     127                                                                elseif ( $total_images > 0 ) :
     128                                                                        $image          = array_shift( $images );
     129                                                                        $featured_image = wp_get_attachment_image( $image, 'featured-thumbnail-formatted' );
     130                                                                endif;
     131                                                ?>
     132                                                <a href="<?php the_permalink(); ?>"><?php echo $featured_image; ?></a>
     133                                                <p class="wp-caption-text">
     134                                                        <?php
     135                                                                printf( _n( 'This gallery contains <a href="%1$s" rel="bookmark">%2$s photo</a>.', 'This gallery contains <a href="%1$s" rel="bookmark">%2$s photos</a>.', $total_images, 'twentyfourteen' ),
     136                                                                        esc_url( get_permalink() ),
     137                                                                        number_format_i18n( $total_images )
     138                                                                );
     139                                                        ?>
     140                                                </p>
     141                                                <?php
     142                                                        else :
     143                                                                the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyfourteen' ) );
     144                                                        endif;
     145                                                ?>
     146                                        </div><!-- .entry-content -->
     147
     148                                        <header class="entry-header">
     149                                                <div class="entry-meta">
     150                                                        <?php
     151                                                                if ( ! has_post_format( 'link' ) ) :
     152                                                                        the_title( '<h1 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h1>' );
     153                                                                endif;
     154
     155                                                                twentyfourteen_posted_on();
     156
     157                                                                if ( ! post_password_required() && ( comments_open() || get_comments_number() ) ) :
     158                                                        ?>
     159                                                        <span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'twentyfourteen' ), __( '1 Comment', 'twentyfourteen' ), __( '% Comments', 'twentyfourteen' ) ); ?></span>
     160                                                        <?php endif; ?>
     161                                                </div><!-- .entry-meta -->
     162                                        </header><!-- .entry-header -->
     163                                </article><!-- #post-## -->
     164                                </li>
     165                                <?php endwhile; ?>
     166
     167                        </ol>
     168                        <a class="more-formatted-posts-link" href="<?php echo esc_url( get_post_format_link( $format ) ); ?>"><?php printf( __( 'More %s <span class="meta-nav">&rarr;</span>', 'twentyfourteen' ), $this->format_strings[ $format ] ); ?></a>
     169                        <?php
     170
     171                        echo $after_widget;
     172
     173                        // Reset the post globals as this query will have stomped on it.
     174                        wp_reset_postdata();
     175
     176                        $GLOBALS['content_width'] = $tmp_content_width;
     177
     178                endif; // End check for ephemeral posts.
     179
     180                set_transient( $this->id, ob_get_flush() );
     181        }
     182
     183        /**
     184         * Deals with the settings when they are saved by the admin. Here is where
     185         * any validation should be dealt with.
     186         *
     187         * @param array $new_instance
     188         * @param array $instance
     189         * @return array
     190         */
     191        function update( $new_instance, $instance ) {
     192                $instance['title']  = strip_tags( $new_instance['title'] );
     193                if ( in_array( $new_instance['format'], $this->formats ) )
     194                        $instance['format'] = $new_instance['format'];
     195
     196                $this->flush_widget_cache();
     197
     198                return $instance;
     199        }
     200
     201        /**
     202         * Deletes the transient.
     203         *
     204         * @return void
     205         */
     206        function flush_widget_cache() {
     207                delete_transient( $this->id );
     208        }
     209
     210        /**
     211         * Displays the form for this widget on the Widgets page of the Admin area.
     212         *
     213         * @param array $instance
     214         * @return void
     215         */
     216        function form( $instance ) {
     217                $title  = isset( $instance['title'] ) ? esc_attr( $instance['title'] ) : '';
     218                $format = in_array( $instance['format'], $this->formats ) ? $instance['format'] : 'aside';
     219                ?>
     220                        <p><label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php _e( 'Title:', 'twentyfourteen' ); ?></label>
     221                        <input id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>" class="widefat" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" /></p>
     222
     223                        <p><label for="<?php echo esc_attr( $this->get_field_id( 'format' ) ); ?>"><?php _e( 'Post format to show:', 'twentyfourteen' ); ?></label>
     224                        <select id="<?php echo esc_attr( $this->get_field_id( 'format' ) ); ?>" class="widefat" name="<?php echo esc_attr( $this->get_field_name( 'format' ) ); ?>">
     225                                <?php foreach ( $this->formats as $slug ) : ?>
     226                                <option value="<?php echo esc_attr( $slug ); ?>"<?php selected( $format, $slug ); ?>><?php echo get_post_format_string( $slug ); ?></option>
     227                                <?php endforeach; ?>
     228                        </select>
     229                <?php
     230        }
     231}
  • wp-content/themes/twentyfourteen/front-page.php

     
    3838                                        </div><!-- #content .site-content -->
    3939                                </div><!-- #primary .content-area -->
    4040
    41                                 <?php get_template_part( 'recent-formatted-posts' ); ?>
     41                                <?php get_template_part( 'ephemera' ); ?>
    4242
    4343                        </div><!-- .front-page-content-area -->
    4444
  • wp-content/themes/twentyfourteen/recent-formatted-posts.php

     
    1 <?php
    2 /**
    3  * A template to display recent post formatted posts.
    4  *
    5  * @package WordPress
    6  * @subpackage Twenty_Fourteen
    7  */
    8 ?>
    9 
    10 <div class="post-formatted-posts">
    11 <?php
    12         do_action( 'before_sidebar' );
    13         do_action( 'twentyfourteen_formatted_posts_before' );
    14         $recent_videos = twentyfourteen_get_recent( 'post-format-video' );
    15         if ( $recent_videos->have_posts() ) :
    16 ?>
    17         <section id="recent-videos" class="recent-videos">
    18                 <h1 class="format-title genericon">
    19                         <a class="entry-format" href="<?php echo esc_url( get_post_format_link( 'video' ) ); ?>" title="<?php esc_attr_e( 'All Video Posts', 'twentyfourteen' ); ?>"><?php _e( 'Videos', 'twentyfourteen' ); ?></a>
    20                 </h1>
    21                 <?php
    22                         while ( $recent_videos->have_posts() ) : $recent_videos->the_post();
    23                                 get_template_part( 'content', 'recent-formatted-post' );
    24                         endwhile;
    25                 ?>
    26                 <a class="more-formatted-posts-link" href="<?php echo esc_url( get_post_format_link( 'video' ) ); ?>" title="<?php esc_attr_e( 'More Videos', 'twentyfourteen' ); ?>"><?php _e( 'More Videos <span class="meta-nav">&rarr;</span>', 'twentyfourteen' ); ?></a>
    27         </section>
    28 <?php endif; ?>
    29 
    30 <?php
    31         $recent_images = twentyfourteen_get_recent( 'post-format-image' );
    32         if ( $recent_images->have_posts() ) :
    33 ?>
    34         <section id="recent-images" class="recent-images">
    35                 <h1 class="format-title genericon">
    36                         <a class="entry-format" href="<?php echo esc_url( get_post_format_link( 'image' ) ); ?>" title="<?php esc_attr_e( 'All Image Posts', 'twentyfourteen' ); ?>"><?php _e( 'Images', 'twentyfourteen' ); ?></a>
    37                 </h1>
    38                 <?php
    39                         while ( $recent_images->have_posts() ) : $recent_images->the_post();
    40                                 get_template_part( 'content', 'recent-formatted-post' );
    41                         endwhile;
    42                 ?>
    43                 <a class="more-formatted-posts-link" href="<?php echo esc_url( get_post_format_link( 'image' ) ); ?>" title="<?php esc_attr_e( 'More images', 'twentyfourteen' ); ?>"><?php _e( 'More images <span class="meta-nav">&rarr;</span>', 'twentyfourteen' ); ?></a>
    44         </section>
    45 <?php endif; ?>
    46 
    47 <?php
    48         $recent_galleries = twentyfourteen_get_recent( 'post-format-gallery' );
    49         if ( $recent_galleries->have_posts() ) :
    50 ?>
    51         <section id="recent-galleries" class="recent-galleries">
    52                 <h1 class="format-title genericon">
    53                         <a class="entry-format" href="<?php echo esc_url( get_post_format_link( 'gallery' ) ); ?>" title="<?php esc_attr_e( 'All Gallery Posts', 'twentyfourteen' ); ?>"><?php _e( 'Galleries', 'twentyfourteen' ); ?></a>
    54                 </h1>
    55                 <?php
    56                         while ( $recent_galleries->have_posts() ) : $recent_galleries->the_post();
    57                                 get_template_part( 'content', 'recent-formatted-post' );
    58                         endwhile;
    59                 ?>
    60                 <a class="more-formatted-posts-link" href="<?php echo esc_url( get_post_format_link( 'gallery' ) ); ?>" title="<?php esc_attr_e( 'More Galleries', 'twentyfourteen' ); ?>"><?php _e( 'More galleries <span class="meta-nav">&rarr;</span>', 'twentyfourteen' ); ?></a>
    61         </section>
    62 <?php endif; ?>
    63 
    64 <?php
    65         $recent_asides = twentyfourteen_get_recent( 'post-format-aside' );
    66         if ( $recent_asides->have_posts() ) :
    67 ?>
    68         <section id="recent-asides" class="recent-asides">
    69                 <h1 class="format-title genericon">
    70                         <a class="entry-format" href="<?php echo esc_url( get_post_format_link( 'aside' ) ); ?>" title="<?php esc_attr_e( 'All Aside Posts', 'twentyfourteen' ); ?>"><?php _e( 'Asides', 'twentyfourteen' ); ?></a>
    71                 </h1>
    72                 <?php
    73                         while ( $recent_asides->have_posts() ) : $recent_asides->the_post();
    74                                 get_template_part( 'content', 'recent-formatted-post' );
    75                         endwhile;
    76                 ?>
    77                 <a class="more-formatted-posts-link" href="<?php echo esc_url( get_post_format_link( 'aside' ) ); ?>" title="<?php esc_attr_e( 'More Asides', 'twentyfourteen' ); ?>"><?php _e( 'More asides <span class="meta-nav">&rarr;</span>', 'twentyfourteen' ); ?></a>
    78         </section>
    79 <?php endif; ?>
    80 
    81 <?php
    82         $recent_links = twentyfourteen_get_recent( 'post-format-link' );
    83         if ( $recent_links->have_posts() ) :
    84 ?>
    85         <section id="recent-links" class="recent-links">
    86                 <h1 class="format-title genericon">
    87                         <a class="entry-format" href="<?php echo esc_url( get_post_format_link( 'link' ) ); ?>" title="<?php esc_attr_e( 'All Link Posts', 'twentyfourteen' ); ?>"><?php _e( 'Links', 'twentyfourteen' ); ?></a>
    88                 </h1>
    89                 <?php
    90                         while ( $recent_links->have_posts() ) : $recent_links->the_post();
    91                                 get_template_part( 'content', 'recent-formatted-post' );
    92                         endwhile;
    93                 ?>
    94                 <a class="more-formatted-posts-link" href="<?php echo esc_url( get_post_format_link( 'link' ) ); ?>" title="<?php esc_attr_e( 'More Links', 'twentyfourteen' ); ?>"><?php _e( 'More links <span class="meta-nav">&rarr;</span>', 'twentyfourteen' ); ?></a>
    95         </section>
    96 <?php endif; ?>
    97 
    98 <?php
    99         $recent_quotes = twentyfourteen_get_recent( 'post-format-quote' );
    100         if ( $recent_quotes->have_posts() ) :
    101 ?>
    102         <section id="recent-quotes" class="recent-quotes">
    103                 <h1 class="format-title genericon">
    104                         <a class="entry-format" href="<?php echo esc_url( get_post_format_link( 'quote' ) ); ?>" title="<?php esc_attr_e( 'All Quote Posts', 'twentyfourteen' ); ?>"><?php _e( 'Quotes', 'twentyfourteen' ); ?></a>
    105                 </h1>
    106                 <?php
    107                         while ( $recent_quotes->have_posts() ) : $recent_quotes->the_post();
    108                                 get_template_part( 'content', 'recent-formatted-post' );
    109                         endwhile;
    110                 ?>
    111                 <a class="more-formatted-posts-link" href="<?php echo esc_url( get_post_format_link( 'quote' ) ); ?>" title="<?php esc_attr_e( 'More Quotes', 'twentyfourteen' ); ?>"><?php _e( 'More quotes <span class="meta-nav">&rarr;</span>', 'twentyfourteen' ); ?></a>
    112         </section>
    113 <?php endif; ?>
    114 
    115 <?php
    116         wp_reset_postdata();
    117         do_action( 'twentyfourteen_formatted_posts_after' );
    118 ?>
    119 
    120 </div>
    121  No newline at end of file
  • wp-content/themes/twentyfourteen/style.css

     
    10481048.group-blog .byline {
    10491049        display: inline;
    10501050}
    1051 .post-formatted-posts .entry-title:after,
     1051.ephemera .entry-title:after,
    10521052#primary span + span.entry-date:before,
    10531053span + .byline:before,
    10541054span + .comments-link:before,
     
    14531453/* =Post Formatted posts column
    14541454----------------------------------------------- */
    14551455
    1456 .post-formatted-posts {
     1456.ephemera {
    14571457        border-top: 1px solid rgba(0, 0, 0, 0.1);
    14581458        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    14591459        -moz-box-sizing: border-box;
     
    14621462        padding: 23px 10px 0;
    14631463        padding: 2.3rem 1.0rem 0;
    14641464}
    1465 .post-formatted-posts .format-title {
     1465.ephemera .widget-title {
    14661466        border-top: 5px solid #000;
    14671467        color: #2b2b2b;
    14681468        font-size: 14px;
     
    14741474        padding-top: 1px;
    14751475        text-transform: uppercase;
    14761476}
    1477 .post-formatted-posts .entry-content a {
     1477.ephemera .entry-content a {
    14781478        word-wrap: break-word;
    14791479}
    1480 .format-title:before {
     1480.ephemera .widget-title:before {
    14811481        background-color: #000;
    14821482        color: #fff;
    14831483        margin-top: -1px;
     
    14901490        width: 36px;
    14911491        width: 3.6rem;
    14921492}
    1493 .recent-videos .format-title:before {
     1493.ephemera .video.widget-title:before {
    14941494        content: '\F104';
    14951495}
    1496 .recent-images .format-title:before {
     1496.ephemera .image.widget-title:before {
    14971497        content: '\F102';
    14981498}
    1499 .recent-galleries .format-title:before {
     1499.ephemera .gallery.widget-title:before {
    15001500        content: '\F103';
    15011501}
    1502 .recent-asides .format-title:before {
     1502.ephemera .aside.widget-title:before {
    15031503        content: '\F101';
    15041504}
    1505 .recent-quotes .format-title:before {
     1505.ephemera .quote.widget-title:before {
    15061506        content: '\F106';
    15071507}
    1508 .recent-links .format-title:before {
     1508.ephemera .link.widget-title:before {
    15091509        content: '\F107';
    15101510}
    1511 .post-formatted-posts .hentry {
     1511.ephemera .hentry {
    15121512        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    15131513        margin-bottom: 18px;
    15141514        margin-bottom: 1.8rem;
    15151515}
    1516 .post-formatted-posts .hentry:last-of-type {
     1516.ephemera .hentry:last-of-type {
    15171517        margin-bottom: 9px;
    15181518        margin-bottom: 0.9rem;
    15191519}
    1520 .post-formatted-posts .entry-title {
     1520.ephemera .entry-title {
    15211521        display: inline;
    15221522        font-size: 12px;
    15231523        font-size: 1.2rem;
     
    15261526        margin: 0 0 6px 0;
    15271527        margin: 0 0 0.6rem 0;
    15281528}
    1529 .post-formatted-posts .entry-meta {
     1529.ephemera .entry-meta {
    15301530        color: rgba(0, 0, 0, 0.2);
    15311531        line-height: 1.5;
    15321532        margin-bottom: 18px;
    15331533        margin-bottom: 1.8rem;
    15341534}
    1535 .post-formatted-posts .entry-meta a {
     1535.ephemera .entry-meta a {
    15361536        color: #8c8c8c;
    15371537}
    1538 .post-formatted-posts .entry-meta a:hover {
     1538.ephemera .entry-meta a:hover {
    15391539        color: #2b2b2b;
    15401540}
    1541 .post-formatted-posts .entry-content p:not(.wp-caption-text) {
     1541.ephemera .entry-content p:not(.wp-caption-text) {
    15421542        font-size: 13px;
    15431543        font-size: 1.3rem;
    15441544        line-height: 1.3846153846;
    15451545        margin-bottom: 18px;
    15461546        margin-bottom: 1.8rem;
    15471547}
    1548 .post-formatted-posts .entry-content blockquote p cite {
     1548.ephemera .entry-content blockquote p cite {
    15491549        font-size: 13px;
    15501550        font-size: 1.3rem;
    15511551        line-height: 1.3846153846;
    15521552}
    1553 .post-formatted-posts .wp-caption {
     1553.ephemera .wp-caption {
    15541554        margin-bottom: 18px;
    15551555        margin-bottom: 1.8rem;
    15561556}
    1557 .post-formatted-posts .wp-caption-text {
     1557.ephemera .wp-caption-text {
    15581558        line-height: 1.5;
    15591559        margin: 6px 0 0;
    15601560        margin: 0.6rem 0 0;
    15611561        padding: 0;
    15621562}
    1563 .post-formatted-posts .format-gallery .wp-caption-text {
     1563.ephemera .format-gallery .wp-caption-text {
    15641564        margin-bottom: 18px;
    15651565        margin-bottom: 1.8rem;
    15661566}
    1567 .post-formatted-posts .more-link {
     1567.ephemera .more-link {
    15681568        font-size: 12px;
    15691569        font-size: 1.2rem;
    15701570        line-height: 1.5;
    15711571}
    1572 .post-formatted-posts .more-formatted-posts-link {
     1572.ephemera .more-formatted-posts-link {
    15731573        display: inline-block;
    15741574        font-size: 12px;
    15751575        font-size: 1.2rem;
     
    21322132        margin-left: 1px;
    21332133        margin-left: 0.1rem;
    21342134}
    2135 .widget div:last-child,
    21362135.widget table:last-child,
    21372136.widget iframe:last-child,
    21382137.widget p:last-child,
     
    25452544                padding: 3.6rem 1.0rem 2.4rem 0;
    25462545                width: 30.35714285%;
    25472546        }
    2548         .post-formatted-posts {
     2547        .ephemera {
    25492548                border: none;
    25502549                clear: none;
    25512550                float: right;
     
    28612860                margin: 0 27.31707317% 0 22.2rem;
    28622861        }
    28632862        #content-sidebar,
    2864         .post-formatted-posts {
     2863        .ephemera {
    28652864                margin: 0 0 0 -27.31707317%;
    28662865                width: 24.87804878%;
    28672866        }
     
    31123111                max-width: 126.0rem;
    31133112        }
    31143113        #content-sidebar,
    3115         .post-formatted-posts {
     3114        .ephemera {
    31163115                padding-right: 0;
    31173116        }
    31183117        #primary .full-width .entry-header,