Ticket #25028: 25028.diff
| File 25028.diff, 28.2 KB (added by , 12 years ago) |
|---|
-
wp-content/themes/twentyfourteen/ephemera.php
7 7 */ 8 8 ?> 9 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">→</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">→</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">→</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">→</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">→</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; 101 25 ?> 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">→</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
123 123 * @return void 124 124 */ 125 125 function twentyfourteen_widgets_init() { 126 require get_template_directory() . '/inc/widgets.php'; 127 register_widget( 'Twenty_Fourteen_Ephemera_Widget' ); 128 126 129 register_sidebar( array( 127 130 'name' => __( 'Primary Sidebar', 'twentyfourteen' ), 128 131 'id' => 'sidebar-1', … … 377 380 } 378 381 379 382 /** 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 it409 *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 page417 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 /**451 383 * Extends the default WordPress body classes. 452 384 * 453 385 * Adds body classes to denote: -
wp-content/themes/twentyfourteen/rtl.css
219 219 /* =Post Formatted posts column 220 220 ----------------------------------------------- */ 221 221 222 . format-title:before {222 .ephemera .widget-title:before { 223 223 margin-left: 10px; 224 224 margin-left: 1.0rem; 225 225 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 12 class 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">→</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">→</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
38 38 </div><!-- #content .site-content --> 39 39 </div><!-- #primary .content-area --> 40 40 41 <?php get_template_part( ' recent-formatted-posts' ); ?>41 <?php get_template_part( 'ephemera' ); ?> 42 42 43 43 </div><!-- .front-page-content-area --> 44 44 -
wp-content/themes/twentyfourteen/recent-formatted-posts.php
1 <?php2 /**3 * A template to display recent post formatted posts.4 *5 * @package WordPress6 * @subpackage Twenty_Fourteen7 */8 ?>9 10 <div class="post-formatted-posts">11 <?php12 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 <?php22 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">→</span>', 'twentyfourteen' ); ?></a>27 </section>28 <?php endif; ?>29 30 <?php31 $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 <?php39 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">→</span>', 'twentyfourteen' ); ?></a>44 </section>45 <?php endif; ?>46 47 <?php48 $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 <?php56 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">→</span>', 'twentyfourteen' ); ?></a>61 </section>62 <?php endif; ?>63 64 <?php65 $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 <?php73 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">→</span>', 'twentyfourteen' ); ?></a>78 </section>79 <?php endif; ?>80 81 <?php82 $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 <?php90 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">→</span>', 'twentyfourteen' ); ?></a>95 </section>96 <?php endif; ?>97 98 <?php99 $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 <?php107 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">→</span>', 'twentyfourteen' ); ?></a>112 </section>113 <?php endif; ?>114 115 <?php116 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
1048 1048 .group-blog .byline { 1049 1049 display: inline; 1050 1050 } 1051 . post-formatted-posts.entry-title:after,1051 .ephemera .entry-title:after, 1052 1052 #primary span + span.entry-date:before, 1053 1053 span + .byline:before, 1054 1054 span + .comments-link:before, … … 1453 1453 /* =Post Formatted posts column 1454 1454 ----------------------------------------------- */ 1455 1455 1456 . post-formatted-posts{1456 .ephemera { 1457 1457 border-top: 1px solid rgba(0, 0, 0, 0.1); 1458 1458 border-bottom: 1px solid rgba(0, 0, 0, 0.1); 1459 1459 -moz-box-sizing: border-box; … … 1462 1462 padding: 23px 10px 0; 1463 1463 padding: 2.3rem 1.0rem 0; 1464 1464 } 1465 . post-formatted-posts .format-title {1465 .ephemera .widget-title { 1466 1466 border-top: 5px solid #000; 1467 1467 color: #2b2b2b; 1468 1468 font-size: 14px; … … 1474 1474 padding-top: 1px; 1475 1475 text-transform: uppercase; 1476 1476 } 1477 . post-formatted-posts.entry-content a {1477 .ephemera .entry-content a { 1478 1478 word-wrap: break-word; 1479 1479 } 1480 . format-title:before {1480 .ephemera .widget-title:before { 1481 1481 background-color: #000; 1482 1482 color: #fff; 1483 1483 margin-top: -1px; … … 1490 1490 width: 36px; 1491 1491 width: 3.6rem; 1492 1492 } 1493 . recent-videos .format-title:before {1493 .ephemera .video.widget-title:before { 1494 1494 content: '\F104'; 1495 1495 } 1496 . recent-images .format-title:before {1496 .ephemera .image.widget-title:before { 1497 1497 content: '\F102'; 1498 1498 } 1499 . recent-galleries .format-title:before {1499 .ephemera .gallery.widget-title:before { 1500 1500 content: '\F103'; 1501 1501 } 1502 . recent-asides .format-title:before {1502 .ephemera .aside.widget-title:before { 1503 1503 content: '\F101'; 1504 1504 } 1505 . recent-quotes .format-title:before {1505 .ephemera .quote.widget-title:before { 1506 1506 content: '\F106'; 1507 1507 } 1508 . recent-links .format-title:before {1508 .ephemera .link.widget-title:before { 1509 1509 content: '\F107'; 1510 1510 } 1511 . post-formatted-posts.hentry {1511 .ephemera .hentry { 1512 1512 border-bottom: 1px solid rgba(0, 0, 0, 0.1); 1513 1513 margin-bottom: 18px; 1514 1514 margin-bottom: 1.8rem; 1515 1515 } 1516 . post-formatted-posts.hentry:last-of-type {1516 .ephemera .hentry:last-of-type { 1517 1517 margin-bottom: 9px; 1518 1518 margin-bottom: 0.9rem; 1519 1519 } 1520 . post-formatted-posts.entry-title {1520 .ephemera .entry-title { 1521 1521 display: inline; 1522 1522 font-size: 12px; 1523 1523 font-size: 1.2rem; … … 1526 1526 margin: 0 0 6px 0; 1527 1527 margin: 0 0 0.6rem 0; 1528 1528 } 1529 . post-formatted-posts.entry-meta {1529 .ephemera .entry-meta { 1530 1530 color: rgba(0, 0, 0, 0.2); 1531 1531 line-height: 1.5; 1532 1532 margin-bottom: 18px; 1533 1533 margin-bottom: 1.8rem; 1534 1534 } 1535 . post-formatted-posts.entry-meta a {1535 .ephemera .entry-meta a { 1536 1536 color: #8c8c8c; 1537 1537 } 1538 . post-formatted-posts.entry-meta a:hover {1538 .ephemera .entry-meta a:hover { 1539 1539 color: #2b2b2b; 1540 1540 } 1541 . post-formatted-posts.entry-content p:not(.wp-caption-text) {1541 .ephemera .entry-content p:not(.wp-caption-text) { 1542 1542 font-size: 13px; 1543 1543 font-size: 1.3rem; 1544 1544 line-height: 1.3846153846; 1545 1545 margin-bottom: 18px; 1546 1546 margin-bottom: 1.8rem; 1547 1547 } 1548 . post-formatted-posts.entry-content blockquote p cite {1548 .ephemera .entry-content blockquote p cite { 1549 1549 font-size: 13px; 1550 1550 font-size: 1.3rem; 1551 1551 line-height: 1.3846153846; 1552 1552 } 1553 . post-formatted-posts.wp-caption {1553 .ephemera .wp-caption { 1554 1554 margin-bottom: 18px; 1555 1555 margin-bottom: 1.8rem; 1556 1556 } 1557 . post-formatted-posts.wp-caption-text {1557 .ephemera .wp-caption-text { 1558 1558 line-height: 1.5; 1559 1559 margin: 6px 0 0; 1560 1560 margin: 0.6rem 0 0; 1561 1561 padding: 0; 1562 1562 } 1563 . post-formatted-posts.format-gallery .wp-caption-text {1563 .ephemera .format-gallery .wp-caption-text { 1564 1564 margin-bottom: 18px; 1565 1565 margin-bottom: 1.8rem; 1566 1566 } 1567 . post-formatted-posts.more-link {1567 .ephemera .more-link { 1568 1568 font-size: 12px; 1569 1569 font-size: 1.2rem; 1570 1570 line-height: 1.5; 1571 1571 } 1572 . post-formatted-posts.more-formatted-posts-link {1572 .ephemera .more-formatted-posts-link { 1573 1573 display: inline-block; 1574 1574 font-size: 12px; 1575 1575 font-size: 1.2rem; … … 2132 2132 margin-left: 1px; 2133 2133 margin-left: 0.1rem; 2134 2134 } 2135 .widget div:last-child,2136 2135 .widget table:last-child, 2137 2136 .widget iframe:last-child, 2138 2137 .widget p:last-child, … … 2545 2544 padding: 3.6rem 1.0rem 2.4rem 0; 2546 2545 width: 30.35714285%; 2547 2546 } 2548 . post-formatted-posts{2547 .ephemera { 2549 2548 border: none; 2550 2549 clear: none; 2551 2550 float: right; … … 2861 2860 margin: 0 27.31707317% 0 22.2rem; 2862 2861 } 2863 2862 #content-sidebar, 2864 . post-formatted-posts{2863 .ephemera { 2865 2864 margin: 0 0 0 -27.31707317%; 2866 2865 width: 24.87804878%; 2867 2866 } … … 3112 3111 max-width: 126.0rem; 3113 3112 } 3114 3113 #content-sidebar, 3115 . post-formatted-posts{3114 .ephemera { 3116 3115 padding-right: 0; 3117 3116 } 3118 3117 #primary .full-width .entry-header,