Twenty Fourteen: add Audio post format support. Props celloexpressions, closes #25807.

Built from https://develop.svn.wordpress.org/trunk@26020


git-svn-id: http://core.svn.wordpress.org/trunk@25951 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Lance Willett 2013-11-05 21:52:09 +00:00
parent 52d6bb332d
commit c1b0fa9039
6 changed files with 85 additions and 5 deletions

View File

@ -0,0 +1,63 @@
<?php
/**
* The template for displaying posts in the Audio post format
*
* @package WordPress
* @subpackage Twenty_Fourteen
* @since Twenty Fourteen 1.0
*/
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php twentyfourteen_post_thumbnail(); ?>
<header class="entry-header">
<?php if ( in_array( 'category', get_object_taxonomies( get_post_type() ) ) && twentyfourteen_categorized_blog() ) : ?>
<div class="entry-meta">
<span class="cat-links"><?php echo get_the_category_list( _x( ', ', 'Used between list items, there is a space after the comma.', 'twentyfourteen' ) ); ?></span>
</div><!-- .entry-meta -->
<?php
endif;
if ( is_single() ) :
the_title( '<h1 class="entry-title">', '</h1>' );
else :
the_title( '<h1 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h1>' );
endif;
?>
<div class="entry-meta">
<span class="post-format">
<a class="entry-format" href="<?php echo esc_url( get_post_format_link( 'audio' ) ); ?>"><?php echo get_post_format_string( 'audio' ); ?></a>
</span>
<?php twentyfourteen_posted_on(); ?>
<?php 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; ?>
<?php edit_post_link( __( 'Edit', 'twentyfourteen' ), '<span class="edit-link">', '</span>' ); ?>
</div><!-- .entry-meta -->
</header><!-- .entry-header -->
<div class="entry-content">
<?php
the_content();
wp_link_pages( array(
'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentyfourteen' ) . '</span>',
'after' => '</div>',
'link_before' => '<span>',
'link_after' => '</span>',
) );
?>
</div><!-- .entry-content -->
<?php if ( has_tag() ) : ?>
<footer class="entry-meta">
<span class="tag-links">
<?php echo get_the_tag_list(); ?>
</span>
</footer><!-- .entry-meta -->
<?php endif; ?>
</article><!-- #post-## -->

View File

@ -91,7 +91,7 @@ function twentyfourteen_setup() {
* See http://codex.wordpress.org/Post_Formats
*/
add_theme_support( 'post-formats', array(
'aside', 'image', 'video', 'quote', 'link', 'gallery',
'aside', 'image', 'video', 'audio', 'quote', 'link', 'gallery',
) );
/*

View File

@ -2,7 +2,7 @@
/**
* Custom Widget for displaying specific post formats
*
* Displays posts from Aside, Quote, Video, Image, Gallery, and Link formats.
* Displays posts from Aside, Quote, Video, Audio, Image, Gallery, and Link formats.
*
* @link http://codex.wordpress.org/Widgets_API#Developing_Widgets
*
@ -20,7 +20,7 @@ class Twenty_Fourteen_Ephemera_Widget extends WP_Widget {
*
* @var array
*/
private $formats = array( 'aside', 'image', 'video', 'quote', 'link', 'gallery' );
private $formats = array( 'aside', 'image', 'video', 'audio', 'quote', 'link', 'gallery' );
/**
* Pluralized post format strings.
@ -41,16 +41,17 @@ class Twenty_Fourteen_Ephemera_Widget extends WP_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' ),
'description' => __( 'Use this widget to list your recent Aside, Quote, Video, Audio, Image, Gallery, and Link posts', 'twentyfourteen' ),
) );
/*
* @todo http://core.trac.wordpress.org/ticket/23257
* @todo http://core.trac.wordpress.org/ticket/23257: Add plural versions of Post Format strings
*/
$this->format_strings = array(
'aside' => __( 'Asides', 'twentyfourteen' ),
'image' => __( 'Images', 'twentyfourteen' ),
'video' => __( 'Videos', 'twentyfourteen' ),
'audio' => __( 'Audio', 'twentyfourteen' ),
'quote' => __( 'Quotes', 'twentyfourteen' ),
'link' => __( 'Links', 'twentyfourteen' ),
'gallery' => __( 'Galleries', 'twentyfourteen' ),

View File

@ -442,6 +442,10 @@ td {
margin: -1px 0 0 2px;
}
.site-content .format-audio .post-format a:before {
margin: -1px 0 0 2px;
}
.site-content .format-image .post-format a:before {
margin: -1px 0 0 3px;
}

View File

@ -2575,6 +2575,10 @@ a.post-thumbnail:hover {
content: "\f104";
}
.content-sidebar .widget_twentyfourteen_ephemera .audio.widget-title:before {
content: "\f109";
}
.content-sidebar .widget_twentyfourteen_ephemera .image.widget-title:before {
content: "\f473";
}
@ -2971,6 +2975,11 @@ a.post-thumbnail:hover {
margin: -1px 2px 0 0;
}
.site-content .format-audio .post-format a:before {
content: "\f109";
margin: -1px 2px 0 0;
}
.site-content .format-image .post-format a:before {
content: "\f473";
margin: -1px 3px 0 0;

View File

@ -33,6 +33,9 @@ get_header(); ?>
elseif ( is_tax( 'post_format', 'post-format-video' ) ) :
_e( 'Videos', 'twentyfourteen' );
elseif ( is_tax( 'post_format', 'post-format-audio' ) ) :
_e( 'Audio', 'twentyfourteen' );
elseif ( is_tax( 'post_format', 'post-format-quote' ) ) :
_e( 'Quotes', 'twentyfourteen' );