Twenty Fourteen: Align post format handling with Twenty Thirteen. Props Frank Klein and obenland, see #24877.
Built from https://develop.svn.wordpress.org/trunk@25088 git-svn-id: http://core.svn.wordpress.org/trunk@25072 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -47,7 +47,7 @@ get_header(); ?>
|
||||
while ( have_posts() ) :
|
||||
the_post();
|
||||
|
||||
twentyfourteen_get_template_part();
|
||||
get_template_part( 'content', get_post_format() );
|
||||
endwhile;
|
||||
twentyfourteen_paging_nav();
|
||||
|
||||
|
||||
60
wp-content/themes/twentyfourteen/content-aside.php
Normal file
60
wp-content/themes/twentyfourteen/content-aside.php
Normal file
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
/**
|
||||
* The template for displaying posts in the Aside post format.
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Twenty_Fourteen
|
||||
*/
|
||||
?>
|
||||
|
||||
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
|
||||
<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; ?>
|
||||
|
||||
<div class="entry-meta">
|
||||
<span class="post-format">
|
||||
<a class="entry-format" href="<?php echo esc_url( get_post_format_link( 'aside' ) ); ?>" title="<?php echo esc_attr( sprintf( __( 'All %s posts', 'twentyfourteen' ), get_post_format_string( 'aside' ) ) ); ?>"><?php echo get_post_format_string( 'aside' ); ?></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( __( 'Continue reading <span class="meta-nav">→</span>', 'twentyfourteen' ) );
|
||||
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 -->
|
||||
|
||||
<footer class="entry-meta">
|
||||
<div class="entry-meta">
|
||||
<?php
|
||||
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>
|
||||
|
||||
<?php if ( has_tag() ) : ?>
|
||||
<span class="tag-links"><?php echo get_the_tag_list(); ?></span>
|
||||
<?php endif; ?>
|
||||
</footer><!-- .entry-meta -->
|
||||
</article><!-- #post-## -->
|
||||
84
wp-content/themes/twentyfourteen/content-gallery.php
Normal file
84
wp-content/themes/twentyfourteen/content-gallery.php
Normal file
@@ -0,0 +1,84 @@
|
||||
<?php
|
||||
/**
|
||||
* The template for displaying posts in the Gallery post format.
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Twenty_Fourteen
|
||||
*/
|
||||
|
||||
if ( has_post_thumbnail() ) :
|
||||
$image = get_post_thumbnail_id();
|
||||
else :
|
||||
$images = get_posts( array(
|
||||
'post_parent' => get_the_ID(),
|
||||
'fields' => 'ids',
|
||||
'numberposts' => 1,
|
||||
'post_status' => 'inherit',
|
||||
'post_type' => 'attachment',
|
||||
'post_mime_type' => 'image',
|
||||
'order' => 'ASC',
|
||||
'orderby' => 'menu_order ID',
|
||||
) );
|
||||
$image = array_shift( $images );
|
||||
endif;
|
||||
?>
|
||||
|
||||
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
|
||||
<?php if( is_single() && $image ) : ?>
|
||||
<div class="attachment-featured-thumbnail">
|
||||
<?php echo wp_get_attachment_image( $image, 'featured-thumbnail-large' ); ?>
|
||||
</div>
|
||||
<?php elseif ( $image ) : ?>
|
||||
<a class="attachment-featured-thumbnail" href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'twentyfourteen' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="<?php the_ID(); ?>">
|
||||
<?php echo wp_get_attachment_image( $image, 'featured-thumbnail-large' ); ?>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
|
||||
<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( 'gallery' ) ); ?>" title="<?php echo esc_attr( sprintf( __( 'All %s posts', 'twentyfourteen' ), get_post_format_string( 'gallery' ) ) ); ?>"><?php echo get_post_format_string( 'gallery' ); ?></a>
|
||||
</span>
|
||||
|
||||
<?php twentyfourteen_posted_on(); ?>
|
||||
|
||||
<?php if ( ! post_password_required() && ( comments_open() || '0' != 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( __( 'Continue reading <span class="meta-nav">→</span>', 'twentyfourteen' ) );
|
||||
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-## -->
|
||||
60
wp-content/themes/twentyfourteen/content-image.php
Normal file
60
wp-content/themes/twentyfourteen/content-image.php
Normal file
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
/**
|
||||
* The template for displaying posts in the Image post format.
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Twenty_Fourteen
|
||||
*/
|
||||
?>
|
||||
|
||||
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
|
||||
<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( 'image' ) ); ?>" title="<?php echo esc_attr( sprintf( __( 'All %s posts', 'twentyfourteen' ), get_post_format_string( 'image' ) ) ); ?>"><?php echo get_post_format_string( 'image' ); ?></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-## -->
|
||||
52
wp-content/themes/twentyfourteen/content-link.php
Normal file
52
wp-content/themes/twentyfourteen/content-link.php
Normal file
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
/**
|
||||
* The template for displaying posts in the Link post format.
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Twenty_Fourteen
|
||||
*/
|
||||
?>
|
||||
|
||||
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
|
||||
<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; ?>
|
||||
|
||||
<div class="entry-meta">
|
||||
<span class="post-format">
|
||||
<a class="entry-format" href="<?php echo esc_url( get_post_format_link( 'link' ) ); ?>" title="<?php echo esc_attr( sprintf( __( 'All %s posts', 'twentyfourteen' ), get_post_format_string( 'link' ) ) ); ?>"><?php echo get_post_format_string( 'link' ); ?></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-## -->
|
||||
@@ -1,73 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @package WordPress
|
||||
* @subpackage Twenty_Fourteen
|
||||
*/
|
||||
?>
|
||||
|
||||
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
|
||||
<?php
|
||||
if ( has_post_format( 'gallery' ) ) :
|
||||
$images = get_children( array( 'post_parent' => get_the_ID(), 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby' => 'menu_order', 'order' => 'ASC' ) );
|
||||
if ( $images ) :
|
||||
$image = array_shift( $images );
|
||||
?>
|
||||
<a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'twentyfourteen' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="<?php the_ID(); ?>" class="attachment-featured-thumbnail">
|
||||
<?php echo wp_get_attachment_image( $image->ID, 'featured-thumbnail-large' ); ?>
|
||||
</a>
|
||||
<?php
|
||||
endif;
|
||||
endif;
|
||||
?>
|
||||
|
||||
<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; ?>
|
||||
|
||||
<?php the_title( '<h1 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h1>' ); ?>
|
||||
|
||||
<div class="entry-meta">
|
||||
<span class="post-format">
|
||||
<a class="entry-format" href="<?php echo esc_url( get_post_format_link( get_post_format() ) ); ?>" title="<?php echo esc_attr( sprintf( __( 'All %s posts', 'twentyfourteen' ), get_post_format_string( get_post_format() ) ) ); ?>"><?php echo get_post_format_string( get_post_format() ); ?></a>
|
||||
</span>
|
||||
|
||||
<?php
|
||||
if ( 'post' == get_post_type() )
|
||||
twentyfourteen_posted_on();
|
||||
|
||||
if ( ! post_password_required() && ( comments_open() || '0' != 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( __( 'Continue reading <span class="meta-nav">→</span>', 'twentyfourteen' ) );
|
||||
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 -->
|
||||
|
||||
<footer class="entry-meta">
|
||||
<?php if ( has_post_format( array( 'quote', 'aside' ) ) ) : ?>
|
||||
<div class="entry-meta">
|
||||
<?php the_title( '<h1 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h1>' ); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( has_tag() ) : ?>
|
||||
<span class="tag-links"><?php echo get_the_tag_list(); ?></span>
|
||||
<?php endif; ?>
|
||||
</footer><!-- .entry-meta -->
|
||||
</article><!-- #post-## -->
|
||||
|
||||
60
wp-content/themes/twentyfourteen/content-quote.php
Normal file
60
wp-content/themes/twentyfourteen/content-quote.php
Normal file
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
/**
|
||||
* The template for displaying posts in the Quote post format.
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Twenty_Fourteen
|
||||
*/
|
||||
?>
|
||||
|
||||
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
|
||||
<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; ?>
|
||||
|
||||
<div class="entry-meta">
|
||||
<span class="post-format">
|
||||
<a class="entry-format" href="<?php echo esc_url( get_post_format_link( 'quote' ) ); ?>" title="<?php echo esc_attr( sprintf( __( 'All %s posts', 'twentyfourteen' ), get_post_format_string( 'quote' ) ) ); ?>"><?php echo get_post_format_string( 'quote' ); ?></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( __( 'Continue reading <span class="meta-nav">→</span>', 'twentyfourteen' ) );
|
||||
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 -->
|
||||
|
||||
<footer class="entry-meta">
|
||||
<div class="entry-meta">
|
||||
<?php
|
||||
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>
|
||||
|
||||
<?php if ( has_tag() ) : ?>
|
||||
<span class="tag-links"><?php echo get_the_tag_list(); ?></span>
|
||||
<?php endif; ?>
|
||||
</footer><!-- .entry-meta -->
|
||||
</article><!-- #post-## -->
|
||||
@@ -1,70 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @package WordPress
|
||||
* @subpackage Twenty_Fourteen
|
||||
*/
|
||||
?>
|
||||
|
||||
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
|
||||
<?php if ( has_post_thumbnail() && ! has_post_format( array( 'video', 'image', 'aside', 'link', 'quote' ) ) ) : ?>
|
||||
<div class="attachment-featured-thumbnail">
|
||||
<?php the_post_thumbnail( 'featured-thumbnail-large' ); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<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 ( ! has_post_format( array( 'status', 'chat', 'aside', 'link', 'quote', 'audio' ) ) ) :
|
||||
the_title( '<h1 class="entry-title">', '</h1>' );
|
||||
endif;
|
||||
?>
|
||||
|
||||
<div class="entry-meta">
|
||||
<?php if ( has_post_format( array( 'status', 'chat', 'aside', 'link', 'quote', 'audio' ) ) ) : ?>
|
||||
<span class="post-format">
|
||||
<a class="entry-format" href="<?php echo esc_url( get_post_format_link( get_post_format() ) ); ?>" title="<?php echo esc_attr( sprintf( __( 'All %s posts', 'twentyfourteen' ), get_post_format_string( get_post_format() ) ) ); ?>"><?php echo get_post_format_string( get_post_format() ); ?></a>
|
||||
</span>
|
||||
<?php endif; ?>
|
||||
|
||||
<?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 -->
|
||||
|
||||
<footer class="entry-meta">
|
||||
<?php if ( has_post_format( array( 'quote', 'aside' ) ) ) : ?>
|
||||
<div class="entry-meta">
|
||||
<?php the_title( '<h1 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h1>' ); ?>
|
||||
</div><!-- .entry-meta -->
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( has_tag() ) : ?>
|
||||
<span class="tag-links">
|
||||
<?php echo get_the_tag_list(); ?>
|
||||
</span>
|
||||
<?php endif; ?>
|
||||
</footer><!-- .entry-meta -->
|
||||
</article><!-- #post-## -->
|
||||
|
||||
60
wp-content/themes/twentyfourteen/content-video.php
Normal file
60
wp-content/themes/twentyfourteen/content-video.php
Normal file
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
/**
|
||||
* The template for displaying posts in the Video post format.
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Twenty_Fourteen
|
||||
*/
|
||||
?>
|
||||
|
||||
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
|
||||
<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( 'video' ) ); ?>" title="<?php echo esc_attr( sprintf( __( 'All %s posts', 'twentyfourteen' ), get_post_format_string( 'video' ) ) ); ?>"><?php echo get_post_format_string( 'video' ); ?></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-## -->
|
||||
@@ -18,16 +18,10 @@
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<h1 class="entry-title"><a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a></h1>
|
||||
<?php the_title( '<h1 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h1>' ); ?>
|
||||
|
||||
<div class="entry-meta">
|
||||
<?php if ( has_post_format( 'gallery' ) ) : ?>
|
||||
<span class="post-format">
|
||||
<a class="entry-format" href="<?php echo esc_url( get_post_format_link( 'gallery' ) ); ?>" title="<?php echo esc_attr( sprintf( __( 'All %s posts', 'twentyfourteen' ), get_post_format_string( 'gallery' ) ) ); ?>"><?php echo get_post_format_string( 'gallery' ); ?></a>
|
||||
</span>
|
||||
<?php
|
||||
endif;
|
||||
|
||||
if ( 'post' == get_post_type() )
|
||||
twentyfourteen_posted_on();
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ get_header(); ?>
|
||||
while ( have_posts() ) :
|
||||
the_post();
|
||||
|
||||
twentyfourteen_get_template_part();
|
||||
get_template_part( 'content', get_post_format() );
|
||||
|
||||
comments_template();
|
||||
endwhile;
|
||||
|
||||
@@ -143,14 +143,3 @@ function twentyfourteen_category_transient_flusher() {
|
||||
}
|
||||
add_action( 'edit_category', 'twentyfourteen_category_transient_flusher' );
|
||||
add_action( 'save_post', 'twentyfourteen_category_transient_flusher' );
|
||||
|
||||
/**
|
||||
* Include the Post-Format-specific template for the content.
|
||||
* This is called in index.php and single.php
|
||||
*/
|
||||
function twentyfourteen_get_template_part() {
|
||||
if ( has_post_format( array( 'aside', 'quote', 'link', 'video', 'image' ) ) )
|
||||
get_template_part( 'content', 'post-format' );
|
||||
else
|
||||
get_template_part( 'content', get_post_format() );
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ get_header(); ?>
|
||||
while ( have_posts() ) :
|
||||
the_post();
|
||||
|
||||
twentyfourteen_get_template_part();
|
||||
get_template_part( 'content', get_post_format() );
|
||||
endwhile;
|
||||
twentyfourteen_paging_nav();
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ get_header(); ?>
|
||||
while ( have_posts() ) :
|
||||
the_post();
|
||||
|
||||
twentyfourteen_get_template_part();
|
||||
get_template_part( 'content', get_post_format() );
|
||||
endwhile;
|
||||
twentyfourteen_paging_nav();
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ get_header(); ?>
|
||||
while ( have_posts() ) :
|
||||
the_post();
|
||||
|
||||
get_template_part( 'content', 'single' );
|
||||
get_template_part( 'content', get_post_format() );
|
||||
|
||||
twentyfourteen_post_nav();
|
||||
|
||||
|
||||
@@ -1025,7 +1025,7 @@ body {
|
||||
display: inline;
|
||||
}
|
||||
.post-formatted-posts .entry-title:after,
|
||||
.content-area span + span.entry-date:before,
|
||||
.content-area span + .entry-date:before,
|
||||
span + .byline:before,
|
||||
span + .comments-link:before,
|
||||
span + .edit-link:before,
|
||||
@@ -1140,11 +1140,6 @@ footer.entry-meta .entry-title a:hover {
|
||||
.format-video {
|
||||
border-top: 1px solid rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
.format-aside .entry-title,
|
||||
.format-quote .entry-title,
|
||||
.format-link .entry-title {
|
||||
display: none;
|
||||
}
|
||||
.format-aside .entry-content,
|
||||
.format-aside .entry-summary,
|
||||
.format-quote .entry-content,
|
||||
|
||||
Reference in New Issue
Block a user