mirror of
git://develop.git.wordpress.org/
synced 2025-01-17 21:08:44 +01:00
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.
git-svn-id: https://develop.svn.wordpress.org/trunk@25090 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
dbe8b7300e
commit
463fde4ec0
@ -38,7 +38,7 @@ get_header(); ?>
|
||||
</div><!-- #content .site-content -->
|
||||
</div><!-- #primary .content-area -->
|
||||
|
||||
<?php get_template_part( 'recent-formatted-posts' ); ?>
|
||||
<?php get_sidebar( 'ephemera' ); ?>
|
||||
|
||||
</div><!-- .front-page-content-area -->
|
||||
|
||||
|
@ -131,31 +131,44 @@ function twentyfourteen_has_featured_posts( $minimum = 1 ) {
|
||||
* @return void
|
||||
*/
|
||||
function twentyfourteen_widgets_init() {
|
||||
require get_template_directory() . '/inc/widgets.php';
|
||||
register_widget( 'Twenty_Fourteen_Ephemera_Widget' );
|
||||
|
||||
register_sidebar( array(
|
||||
'name' => __( 'Primary Sidebar', 'twentyfourteen' ),
|
||||
'id' => 'sidebar-1',
|
||||
'description' => __( 'Main sidebar that appears on the left.', 'twentyfourteen' ),
|
||||
'name' => __( 'Primary Sidebar', 'twentyfourteen' ),
|
||||
'id' => 'sidebar-1',
|
||||
'description' => __( 'Main sidebar that appears on the left.', 'twentyfourteen' ),
|
||||
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
|
||||
'after_widget' => '</aside>',
|
||||
'before_title' => '<h1 class="widget-title">',
|
||||
'after_title' => '</h1>',
|
||||
'after_widget' => '</aside>',
|
||||
'before_title' => '<h1 class="widget-title">',
|
||||
'after_title' => '</h1>',
|
||||
) );
|
||||
register_sidebar( array(
|
||||
'name' => __( 'Content Sidebar', 'twentyfourteen' ),
|
||||
'id' => 'sidebar-2',
|
||||
'description' => __( 'Additional sidebar that appears on the right, on single posts and pages.', 'twentyfourteen' ),
|
||||
'name' => __( 'Front Page Sidebar', 'twentyfourteen' ),
|
||||
'id' => 'sidebar-2',
|
||||
'description' => __( 'Additional sidebar that appears on the right, on the home page.', 'twentyfourteen' ),
|
||||
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
|
||||
'after_widget' => '</aside>',
|
||||
'before_title' => '<h1 class="widget-title">',
|
||||
'after_title' => '</h1>',
|
||||
'after_widget' => '</aside>',
|
||||
'before_title' => '<h1 class="widget-title">',
|
||||
'after_title' => '</h1>',
|
||||
) );
|
||||
register_sidebar( array(
|
||||
'name' => __( 'Footer Widget Area', 'twentyfourteen' ),
|
||||
'id' => 'sidebar-3',
|
||||
'name' => __( 'Content Sidebar', 'twentyfourteen' ),
|
||||
'id' => 'sidebar-3',
|
||||
'description' => __( 'Additional sidebar that appears on the right, on single posts and pages.', 'twentyfourteen' ),
|
||||
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
|
||||
'after_widget' => '</aside>',
|
||||
'before_title' => '<h1 class="widget-title">',
|
||||
'after_title' => '</h1>',
|
||||
'after_widget' => '</aside>',
|
||||
'before_title' => '<h1 class="widget-title">',
|
||||
'after_title' => '</h1>',
|
||||
) );
|
||||
register_sidebar( array(
|
||||
'name' => __( 'Footer Widget Area', 'twentyfourteen' ),
|
||||
'id' => 'sidebar-4',
|
||||
'description' => __( 'Appears in the footer section of the site.', 'twentyfourteen' ),
|
||||
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
|
||||
'after_widget' => '</aside>',
|
||||
'before_title' => '<h1 class="widget-title">',
|
||||
'after_title' => '</h1>',
|
||||
) );
|
||||
}
|
||||
add_action( 'widgets_init', 'twentyfourteen_widgets_init' );
|
||||
|
248
src/wp-content/themes/twentyfourteen/inc/widgets.php
Normal file
248
src/wp-content/themes/twentyfourteen/inc/widgets.php
Normal file
@ -0,0 +1,248 @@
|
||||
<?php
|
||||
/**
|
||||
* Makes a custom Widget for displaying Aside, Quote, Video, Image, Gallery,
|
||||
* and Link posts, available with Twenty Fourteen.
|
||||
*
|
||||
* Learn more: http://codex.wordpress.org/Widgets_API#Developing_Widgets
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Twenty_Fourteen
|
||||
*/
|
||||
|
||||
class Twenty_Fourteen_Ephemera_Widget extends WP_Widget {
|
||||
|
||||
/**
|
||||
* The supported post formats.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
private $formats = array( 'aside', 'image', 'video', 'quote', 'link', 'gallery' );
|
||||
|
||||
/**
|
||||
* Pluralized post format strings.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
private $format_strings;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @return Twenty_Fourteen_Ephemera_Widget
|
||||
*/
|
||||
public function __construct() {
|
||||
parent::__construct( 'widget_twentyfourteen_ephemera', __( 'Twenty Fourteen Ephemera', 'twentyfourteen' ), array(
|
||||
'classname' => 'widget_twentyfourteen_ephemera',
|
||||
'description' => __( 'Use this widget to list your recent Aside, Quote, Video, Image, Gallery, and Link posts', 'twentyfourteen' ),
|
||||
) );
|
||||
|
||||
/**
|
||||
* @todo http://core.trac.wordpress.org/ticket/23257
|
||||
*/
|
||||
$this->format_strings = array(
|
||||
'aside' => __( 'Asides', 'twentyfourteen' ),
|
||||
'image' => __( 'Images', 'twentyfourteen' ),
|
||||
'video' => __( 'Videos', 'twentyfourteen' ),
|
||||
'quote' => __( 'Quotes', 'twentyfourteen' ),
|
||||
'link' => __( 'Links', 'twentyfourteen' ),
|
||||
'gallery' => __( 'Galleries', 'twentyfourteen' ),
|
||||
);
|
||||
|
||||
add_action( 'save_post', array( $this, 'flush_widget_cache' ) );
|
||||
add_action( 'deleted_post', array( $this, 'flush_widget_cache' ) );
|
||||
add_action( 'switch_theme', array( $this, 'flush_widget_cache' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Outputs the HTML for this widget.
|
||||
*
|
||||
* @param array $args An array of standard parameters for widgets in this theme.
|
||||
* @param array $instance An array of settings for this widget instance.
|
||||
* @return void Echoes its output.
|
||||
*/
|
||||
public function widget( $args, $instance ) {
|
||||
// If called directly, assign an unique index for caching.
|
||||
if ( -1 == $this->number ) {
|
||||
static $num = -1;
|
||||
$this->_set( --$num );
|
||||
}
|
||||
|
||||
$content = get_transient( $this->id );
|
||||
|
||||
if ( false !== $content ) {
|
||||
echo $content;
|
||||
return;
|
||||
}
|
||||
|
||||
ob_start();
|
||||
extract( $args, EXTR_SKIP );
|
||||
|
||||
$format = $instance['format'];
|
||||
$number = empty( $instance['number'] ) ? 2 : absint( $instance['number'] );
|
||||
$title = apply_filters( 'widget_title', empty( $instance['title'] ) ? $this->format_strings[ $format ] : $instance['title'], $instance, $this->id_base );
|
||||
|
||||
$ephemera = new WP_Query( array(
|
||||
'order' => 'DESC',
|
||||
'posts_per_page' => $number,
|
||||
'no_found_rows' => true,
|
||||
'post_status' => 'publish',
|
||||
'post__not_in' => get_option( 'sticky_posts' ),
|
||||
'tax_query' => array(
|
||||
array(
|
||||
'taxonomy' => 'post_format',
|
||||
'terms' => array( "post-format-$format" ),
|
||||
'field' => 'slug',
|
||||
'operator' => 'IN',
|
||||
),
|
||||
),
|
||||
) );
|
||||
|
||||
if ( $ephemera->have_posts() ) :
|
||||
$tmp_content_width = $GLOBALS['content_width'];
|
||||
$GLOBALS['content_width'] = 306;
|
||||
|
||||
echo $before_widget;
|
||||
?>
|
||||
<h1 class="widget-title genericon <?php echo esc_attr( $format ); ?>">
|
||||
<a class="entry-format" href="<?php echo esc_url( get_post_format_link( $format ) ); ?>"><?php echo $title; ?></a>
|
||||
</h1>
|
||||
<ol>
|
||||
|
||||
<?php while ( $ephemera->have_posts() ) : $ephemera->the_post(); ?>
|
||||
<li>
|
||||
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
|
||||
<div class="entry-content">
|
||||
<?php
|
||||
if ( has_post_format( 'gallery' ) ) :
|
||||
$images = get_posts( array(
|
||||
'post_parent' => get_post()->post_parent,
|
||||
'fields' => 'ids',
|
||||
'numberposts' => -1,
|
||||
'post_status' => 'inherit',
|
||||
'post_type' => 'attachment',
|
||||
'post_mime_type' => 'image',
|
||||
'order' => 'ASC',
|
||||
'orderby' => 'menu_order ID'
|
||||
) );
|
||||
$total_images = count( $images );
|
||||
|
||||
if ( has_post_thumbnail() ) :
|
||||
$featured_image = get_the_post_thumbnail( get_the_ID(), 'featured-thumbnail-formatted' );
|
||||
elseif ( $total_images > 0 ) :
|
||||
$image = array_shift( $images );
|
||||
$featured_image = wp_get_attachment_image( $image, 'featured-thumbnail-formatted' );
|
||||
endif;
|
||||
?>
|
||||
<a href="<?php the_permalink(); ?>"><?php echo $featured_image; ?></a>
|
||||
<p class="wp-caption-text">
|
||||
<?php
|
||||
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' ),
|
||||
esc_url( get_permalink() ),
|
||||
number_format_i18n( $total_images )
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
<?php
|
||||
else :
|
||||
the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'twentyfourteen' ) );
|
||||
endif;
|
||||
?>
|
||||
</div><!-- .entry-content -->
|
||||
|
||||
<header class="entry-header">
|
||||
<div class="entry-meta">
|
||||
<?php
|
||||
if ( ! has_post_format( 'link' ) ) :
|
||||
the_title( '<h1 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h1>' );
|
||||
endif;
|
||||
|
||||
printf( __( '<span class="entry-date"><a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s">%4$s</time></a></span> <span class="byline"><span class="author vcard"><a class="url fn n" href="%5$s" title="%6$s" rel="author">%7$s</a></span></span>', 'twentyfourteen' ),
|
||||
esc_url( get_permalink() ),
|
||||
esc_attr( get_the_time() ),
|
||||
esc_attr( get_the_date( 'c' ) ),
|
||||
esc_html( get_the_date() ),
|
||||
esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
|
||||
esc_attr( sprintf( __( 'View all posts by %s', 'twentyfourteen' ), get_the_author() ) ),
|
||||
get_the_author()
|
||||
);
|
||||
|
||||
if ( ! post_password_required() && ( comments_open() || get_comments_number() ) ) :
|
||||
?>
|
||||
<span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'twentyfourteen' ), __( '1 Comment', 'twentyfourteen' ), __( '% Comments', 'twentyfourteen' ) ); ?></span>
|
||||
<?php endif; ?>
|
||||
</div><!-- .entry-meta -->
|
||||
</header><!-- .entry-header -->
|
||||
</article><!-- #post-## -->
|
||||
</li>
|
||||
<?php endwhile; ?>
|
||||
|
||||
</ol>
|
||||
<a class="post-format-archive-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>
|
||||
<?php
|
||||
|
||||
echo $after_widget;
|
||||
|
||||
// Reset the post globals as this query will have stomped on it.
|
||||
wp_reset_postdata();
|
||||
|
||||
$GLOBALS['content_width'] = $tmp_content_width;
|
||||
|
||||
endif; // End check for ephemeral posts.
|
||||
|
||||
set_transient( $this->id, ob_get_flush() );
|
||||
}
|
||||
|
||||
/**
|
||||
* Deals with the settings when they are saved by the admin. Here is where
|
||||
* any validation should be dealt with.
|
||||
*
|
||||
* @param array $new_instance
|
||||
* @param array $instance
|
||||
* @return array
|
||||
*/
|
||||
function update( $new_instance, $instance ) {
|
||||
$instance['title'] = strip_tags( $new_instance['title'] );
|
||||
$instance['number'] = empty( $new_instance['number'] ) ? 2 : absint( $new_instance['number'] );
|
||||
if ( in_array( $new_instance['format'], $this->formats ) )
|
||||
$instance['format'] = $new_instance['format'];
|
||||
|
||||
$this->flush_widget_cache();
|
||||
|
||||
return $instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes the transient.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function flush_widget_cache() {
|
||||
delete_transient( $this->id );
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays the form for this widget on the Widgets page of the Admin area.
|
||||
*
|
||||
* @param array $instance
|
||||
* @return void
|
||||
*/
|
||||
function form( $instance ) {
|
||||
$title = empty( $instance['title'] ) ? '' : esc_attr( $instance['title'] );
|
||||
$number = empty( $instance['number'] ) ? 2 : absint( $instance['number'] );
|
||||
$format = isset( $instance['format'] ) && in_array( $instance['format'], $this->formats ) ? $instance['format'] : 'aside';
|
||||
?>
|
||||
<p><label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php _e( 'Title:', 'twentyfourteen' ); ?></label>
|
||||
<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>
|
||||
|
||||
<p><label for="<?php echo esc_attr( $this->get_field_id( 'number' ) ); ?>"><?php _e( 'Number of posts to show:', 'twentyfourteen' ); ?></label>
|
||||
<input id="<?php echo esc_attr( $this->get_field_id( 'number' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'number' ) ); ?>" type="text" value="<?php echo esc_attr( $number ); ?>" size="3" /></p>
|
||||
|
||||
<p><label for="<?php echo esc_attr( $this->get_field_id( 'format' ) ); ?>"><?php _e( 'Post format to show:', 'twentyfourteen' ); ?></label>
|
||||
<select id="<?php echo esc_attr( $this->get_field_id( 'format' ) ); ?>" class="widefat" name="<?php echo esc_attr( $this->get_field_name( 'format' ) ); ?>">
|
||||
<?php foreach ( $this->formats as $slug ) : ?>
|
||||
<option value="<?php echo esc_attr( $slug ); ?>"<?php selected( $format, $slug ); ?>><?php echo get_post_format_string( $slug ); ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<?php
|
||||
}
|
||||
}
|
@ -1,120 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* A template to display recent post formatted posts.
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Twenty_Fourteen
|
||||
*/
|
||||
?>
|
||||
|
||||
<div class="post-formatted-posts">
|
||||
<?php
|
||||
do_action( 'before_sidebar' );
|
||||
do_action( 'twentyfourteen_formatted_posts_before' );
|
||||
$recent_videos = twentyfourteen_get_recent( 'post-format-video' );
|
||||
if ( $recent_videos->have_posts() ) :
|
||||
?>
|
||||
<section id="recent-videos" class="recent-videos">
|
||||
<h1 class="format-title genericon">
|
||||
<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>
|
||||
</h1>
|
||||
<?php
|
||||
while ( $recent_videos->have_posts() ) : $recent_videos->the_post();
|
||||
get_template_part( 'content', 'recent-formatted-post' );
|
||||
endwhile;
|
||||
?>
|
||||
<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>
|
||||
</section>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
$recent_images = twentyfourteen_get_recent( 'post-format-image' );
|
||||
if ( $recent_images->have_posts() ) :
|
||||
?>
|
||||
<section id="recent-images" class="recent-images">
|
||||
<h1 class="format-title genericon">
|
||||
<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>
|
||||
</h1>
|
||||
<?php
|
||||
while ( $recent_images->have_posts() ) : $recent_images->the_post();
|
||||
get_template_part( 'content', 'recent-formatted-post' );
|
||||
endwhile;
|
||||
?>
|
||||
<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>
|
||||
</section>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
$recent_galleries = twentyfourteen_get_recent( 'post-format-gallery' );
|
||||
if ( $recent_galleries->have_posts() ) :
|
||||
?>
|
||||
<section id="recent-galleries" class="recent-galleries">
|
||||
<h1 class="format-title genericon">
|
||||
<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>
|
||||
</h1>
|
||||
<?php
|
||||
while ( $recent_galleries->have_posts() ) : $recent_galleries->the_post();
|
||||
get_template_part( 'content', 'recent-formatted-post' );
|
||||
endwhile;
|
||||
?>
|
||||
<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>
|
||||
</section>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
$recent_asides = twentyfourteen_get_recent( 'post-format-aside' );
|
||||
if ( $recent_asides->have_posts() ) :
|
||||
?>
|
||||
<section id="recent-asides" class="recent-asides">
|
||||
<h1 class="format-title genericon">
|
||||
<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>
|
||||
</h1>
|
||||
<?php
|
||||
while ( $recent_asides->have_posts() ) : $recent_asides->the_post();
|
||||
get_template_part( 'content', 'recent-formatted-post' );
|
||||
endwhile;
|
||||
?>
|
||||
<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>
|
||||
</section>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
$recent_links = twentyfourteen_get_recent( 'post-format-link' );
|
||||
if ( $recent_links->have_posts() ) :
|
||||
?>
|
||||
<section id="recent-links" class="recent-links">
|
||||
<h1 class="format-title genericon">
|
||||
<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>
|
||||
</h1>
|
||||
<?php
|
||||
while ( $recent_links->have_posts() ) : $recent_links->the_post();
|
||||
get_template_part( 'content', 'recent-formatted-post' );
|
||||
endwhile;
|
||||
?>
|
||||
<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>
|
||||
</section>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
$recent_quotes = twentyfourteen_get_recent( 'post-format-quote' );
|
||||
if ( $recent_quotes->have_posts() ) :
|
||||
?>
|
||||
<section id="recent-quotes" class="recent-quotes">
|
||||
<h1 class="format-title genericon">
|
||||
<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>
|
||||
</h1>
|
||||
<?php
|
||||
while ( $recent_quotes->have_posts() ) : $recent_quotes->the_post();
|
||||
get_template_part( 'content', 'recent-formatted-post' );
|
||||
endwhile;
|
||||
?>
|
||||
<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>
|
||||
</section>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
wp_reset_postdata();
|
||||
do_action( 'twentyfourteen_formatted_posts_after' );
|
||||
?>
|
||||
|
||||
</div>
|
@ -219,7 +219,7 @@ blockquote.pull.alignleft {
|
||||
/* =Post Formatted posts column
|
||||
----------------------------------------------- */
|
||||
|
||||
.format-title:before {
|
||||
.ephemera .widget-title:before {
|
||||
margin-left: 10px;
|
||||
margin-left: 1.0rem;
|
||||
margin-right: auto;
|
||||
|
@ -9,7 +9,7 @@
|
||||
<div id="content-sidebar" class="content-sidebar widget-area" role="complementary">
|
||||
<?php do_action( 'before_sidebar' ); ?>
|
||||
|
||||
<?php if ( ! dynamic_sidebar( 'sidebar-2' ) ) : ?>
|
||||
<?php if ( ! dynamic_sidebar( 'sidebar-3' ) ) : ?>
|
||||
<aside id="search" class="widget widget_search">
|
||||
<?php get_search_form(); ?>
|
||||
</aside>
|
||||
|
27
src/wp-content/themes/twentyfourteen/sidebar-ephemera.php
Normal file
27
src/wp-content/themes/twentyfourteen/sidebar-ephemera.php
Normal file
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* A template to display recent post formatted posts.
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Twenty_Fourteen
|
||||
*/
|
||||
?>
|
||||
|
||||
<div id="ephemera" class="ephemera" role="complementary">
|
||||
<?php
|
||||
if ( ! dynamic_sidebar( 'sidebar-2' ) ) :
|
||||
foreach ( array( 'video', 'image', 'gallery', 'aside', 'link', 'quote' ) as $format ) :
|
||||
the_widget(
|
||||
'Twenty_Fourteen_Ephemera_Widget',
|
||||
array(
|
||||
'format' => $format,
|
||||
),
|
||||
array(
|
||||
'before_widget' => '<aside class="widget widget_twentyfourteen_ephemera">',
|
||||
'after_widget' => '</aside>',
|
||||
)
|
||||
);
|
||||
endforeach;
|
||||
endif;
|
||||
?>
|
||||
</div>
|
@ -5,17 +5,13 @@
|
||||
* @package WordPress
|
||||
* @subpackage Twenty_Fourteen
|
||||
*/
|
||||
?>
|
||||
<?php
|
||||
if ( ! is_active_sidebar( 'sidebar-3' ) )
|
||||
|
||||
if ( ! is_active_sidebar( 'sidebar-4' ) )
|
||||
return;
|
||||
?>
|
||||
|
||||
<div id="supplementary">
|
||||
|
||||
<?php if ( is_active_sidebar( 'sidebar-3' ) ) : ?>
|
||||
<div id="footer-sidebar" class="widget-area" role="complementary">
|
||||
<?php dynamic_sidebar( 'sidebar-3' ); ?>
|
||||
<?php dynamic_sidebar( 'sidebar-4' ); ?>
|
||||
</div><!-- #footer-sidebar -->
|
||||
<?php endif; ?>
|
||||
|
||||
</div><!-- #supplementary -->
|
||||
|
@ -428,7 +428,7 @@ a:active {
|
||||
/* Animated elements */
|
||||
.site a,
|
||||
.more-link .meta-nav,
|
||||
.more-formatted-posts-link .meta-nav,
|
||||
.post-format-archive-link .meta-nav,
|
||||
.attachment-featured-featured img,
|
||||
.attachment-featured-thumbnail img,
|
||||
.social-links-toggle,
|
||||
@ -1028,7 +1028,7 @@ body {
|
||||
.group-blog .byline {
|
||||
display: inline;
|
||||
}
|
||||
.post-formatted-posts .entry-title:after,
|
||||
.ephemera .entry-title:after,
|
||||
.content-area span + .entry-date:before,
|
||||
span + .byline:before,
|
||||
span + .comments-link:before,
|
||||
@ -1182,23 +1182,23 @@ footer.entry-meta .entry-title a:hover {
|
||||
text-transform: none;
|
||||
}
|
||||
.more-link,
|
||||
.more-formatted-posts-link {
|
||||
.post-format-archive-link {
|
||||
font-size: 14px;
|
||||
font-size: 1.4rem;
|
||||
text-transform: uppercase;
|
||||
white-space: pre;
|
||||
}
|
||||
.more-link:hover,
|
||||
.more-formatted-posts-link:hover {
|
||||
.post-format-archive-link:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
.more-link .meta-nav,
|
||||
.more-formatted-posts-link .meta-nav {
|
||||
.post-format-archive-link .meta-nav {
|
||||
position: relative;
|
||||
left: 0;
|
||||
}
|
||||
.more-link:hover .meta-nav,
|
||||
.more-formatted-posts-link:hover .meta-nav {
|
||||
.post-format-archive-link:hover .meta-nav {
|
||||
left: 5px;
|
||||
left: 0.5rem;
|
||||
}
|
||||
@ -1430,7 +1430,7 @@ footer.entry-meta .entry-title a:hover {
|
||||
/* =Post Formatted posts column
|
||||
----------------------------------------------- */
|
||||
|
||||
.post-formatted-posts {
|
||||
.ephemera {
|
||||
border-top: 1px solid rgba(0, 0, 0, 0.1);
|
||||
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
|
||||
-moz-box-sizing: border-box;
|
||||
@ -1439,7 +1439,7 @@ footer.entry-meta .entry-title a:hover {
|
||||
padding: 23px 10px 0;
|
||||
padding: 2.3rem 1.0rem 0;
|
||||
}
|
||||
.post-formatted-posts .format-title {
|
||||
.ephemera .widget-title {
|
||||
border-top: 5px solid #000;
|
||||
color: #2b2b2b;
|
||||
font-size: 14px;
|
||||
@ -1451,10 +1451,10 @@ footer.entry-meta .entry-title a:hover {
|
||||
padding-top: 1px;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
.post-formatted-posts .entry-content a {
|
||||
.ephemera .entry-content a {
|
||||
word-wrap: break-word;
|
||||
}
|
||||
.format-title:before {
|
||||
.ephemera .widget-title:before {
|
||||
background-color: #000;
|
||||
color: #fff;
|
||||
margin-top: -1px;
|
||||
@ -1467,34 +1467,34 @@ footer.entry-meta .entry-title a:hover {
|
||||
width: 36px;
|
||||
width: 3.6rem;
|
||||
}
|
||||
.recent-videos .format-title:before {
|
||||
.ephemera .video.widget-title:before {
|
||||
content: '\F104';
|
||||
}
|
||||
.recent-images .format-title:before {
|
||||
.ephemera .image.widget-title:before {
|
||||
content: '\F102';
|
||||
}
|
||||
.recent-galleries .format-title:before {
|
||||
.ephemera .gallery.widget-title:before {
|
||||
content: '\F103';
|
||||
}
|
||||
.recent-asides .format-title:before {
|
||||
.ephemera .aside.widget-title:before {
|
||||
content: '\F101';
|
||||
}
|
||||
.recent-quotes .format-title:before {
|
||||
.ephemera .quote.widget-title:before {
|
||||
content: '\F106';
|
||||
}
|
||||
.recent-links .format-title:before {
|
||||
.ephemera .link.widget-title:before {
|
||||
content: '\F107';
|
||||
}
|
||||
.post-formatted-posts .hentry {
|
||||
.ephemera .hentry {
|
||||
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
|
||||
margin-bottom: 18px;
|
||||
margin-bottom: 1.8rem;
|
||||
}
|
||||
.post-formatted-posts .hentry:last-of-type {
|
||||
.ephemera .hentry:last-of-type {
|
||||
margin-bottom: 9px;
|
||||
margin-bottom: 0.9rem;
|
||||
}
|
||||
.post-formatted-posts .entry-title {
|
||||
.ephemera .entry-title {
|
||||
display: inline;
|
||||
font-size: 12px;
|
||||
font-size: 1.2rem;
|
||||
@ -1503,50 +1503,50 @@ footer.entry-meta .entry-title a:hover {
|
||||
margin: 0 0 6px 0;
|
||||
margin: 0 0 0.6rem 0;
|
||||
}
|
||||
.post-formatted-posts .entry-meta {
|
||||
.ephemera .entry-meta {
|
||||
color: rgba(0, 0, 0, 0.2);
|
||||
line-height: 1.5;
|
||||
margin-bottom: 18px;
|
||||
margin-bottom: 1.8rem;
|
||||
}
|
||||
.post-formatted-posts .entry-meta a {
|
||||
.ephemera .entry-meta a {
|
||||
color: #767676;
|
||||
}
|
||||
.post-formatted-posts .entry-meta a:hover {
|
||||
.ephemera .entry-meta a:hover {
|
||||
color: #2b2b2b;
|
||||
}
|
||||
.post-formatted-posts .entry-content p:not(.wp-caption-text) {
|
||||
.ephemera .entry-content p:not(.wp-caption-text) {
|
||||
font-size: 13px;
|
||||
font-size: 1.3rem;
|
||||
line-height: 1.3846153846;
|
||||
margin-bottom: 18px;
|
||||
margin-bottom: 1.8rem;
|
||||
}
|
||||
.post-formatted-posts .entry-content blockquote p cite {
|
||||
.ephemera .entry-content blockquote p cite {
|
||||
font-size: 13px;
|
||||
font-size: 1.3rem;
|
||||
line-height: 1.3846153846;
|
||||
}
|
||||
.post-formatted-posts .wp-caption {
|
||||
.ephemera .wp-caption {
|
||||
margin-bottom: 18px;
|
||||
margin-bottom: 1.8rem;
|
||||
}
|
||||
.post-formatted-posts .wp-caption-text {
|
||||
.ephemera .wp-caption-text {
|
||||
line-height: 1.5;
|
||||
margin: 6px 0 0;
|
||||
margin: 0.6rem 0 0;
|
||||
padding: 0;
|
||||
}
|
||||
.post-formatted-posts .format-gallery .wp-caption-text {
|
||||
.ephemera .format-gallery .wp-caption-text {
|
||||
margin-bottom: 18px;
|
||||
margin-bottom: 1.8rem;
|
||||
}
|
||||
.post-formatted-posts .more-link {
|
||||
.ephemera .more-link {
|
||||
font-size: 12px;
|
||||
font-size: 1.2rem;
|
||||
line-height: 1.5;
|
||||
}
|
||||
.post-formatted-posts .more-formatted-posts-link {
|
||||
.ephemera .post-format-archive-link {
|
||||
display: inline-block;
|
||||
font-size: 12px;
|
||||
font-size: 1.2rem;
|
||||
@ -2106,7 +2106,6 @@ span > object {
|
||||
margin-left: 1px;
|
||||
margin-left: 0.1rem;
|
||||
}
|
||||
.widget div:last-child,
|
||||
.widget table:last-child,
|
||||
.widget iframe:last-child,
|
||||
.widget p:last-child,
|
||||
@ -2518,7 +2517,7 @@ span > object {
|
||||
padding: 3.6rem 1.0rem 2.4rem 0;
|
||||
width: 30.35714285%;
|
||||
}
|
||||
.post-formatted-posts {
|
||||
.ephemera {
|
||||
border: none;
|
||||
clear: none;
|
||||
float: right;
|
||||
@ -2823,7 +2822,7 @@ span > object {
|
||||
margin: 0 27.31707317% 0 22.2rem;
|
||||
}
|
||||
.content-sidebar,
|
||||
.post-formatted-posts {
|
||||
.ephemera {
|
||||
margin: 0 0 0 -27.31707317%;
|
||||
width: 24.87804878%;
|
||||
}
|
||||
@ -3055,7 +3054,7 @@ span > object {
|
||||
max-width: 126.0rem;
|
||||
}
|
||||
.content-sidebar,
|
||||
.post-formatted-posts {
|
||||
.ephemera {
|
||||
padding-right: 0;
|
||||
}
|
||||
.content-area .full-width .entry-header,
|
||||
|
Loading…
x
Reference in New Issue
Block a user