mirror of
https://github.com/WordPress/WordPress.git
synced 2024-09-11 23:28:18 +02:00
A magazine theme with clean, responsive design focused on highlighting featured content prominently on home page. This is slated for 3.8. Development will occur in trunk for the theme, and in plugins for the nice-to-have features. Nice-to-have improvements include: - Add a Contributors page template to highlight authors. - Easy-to-manage featured content. - Add support for an Authors widget to highlight authors. Welcome, Twenty Fourteen né Further. Props iamtakashi, see #24858. git-svn-id: http://core.svn.wordpress.org/trunk@24832 1a063a9b-81f0-0310-95a4-ce76da25c4cd
54 lines
2.3 KiB
PHP
54 lines
2.3 KiB
PHP
<?php
|
|
/**
|
|
* @package WordPress
|
|
* @subpackage Twenty_Fourteen
|
|
*/
|
|
if ( isset( $GLOBALS['content_width'] ) )
|
|
$GLOBALS['content_width'] = 306;
|
|
|
|
$format = get_post_format();
|
|
if ( false === $format )
|
|
$format = 'standard';
|
|
?>
|
|
|
|
<article id="post-<?php the_ID(); ?>" <?php post_class( 'clearfix' ); ?>>
|
|
<div class="entry-content clearfix">
|
|
<?php
|
|
if ( 'gallery' == $format ) :
|
|
$featured_image = get_the_post_thumbnail( get_the_ID(), 'featured-thumbnail-formatted' );
|
|
$images = get_children( array( 'post_parent' => $post->ID, 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby' => 'menu_order', 'order' => 'ASC' ) );
|
|
if ( $images ) :
|
|
$total_images = count( $images );
|
|
if ( empty( $featured_image ) ) {
|
|
$image = array_shift( $images );
|
|
$featured_image = wp_get_attachment_image( $image->ID, 'featured-thumbnail-formatted' );
|
|
}
|
|
?>
|
|
<a href="<?php the_permalink(); ?>"><?php echo $featured_image; ?></a>
|
|
<p class="wp-caption-text"><?php printf( _n( 'This gallery contains <a %1$s>%2$s photo</a>.', 'This gallery contains <a %1$s>%2$s photos</a>.', $total_images, 'twentyfourteen' ),
|
|
'href="' . get_permalink() . '" title="' . esc_attr( sprintf( __( 'Permalink to %s', 'twentyfourteen' ), the_title_attribute( 'echo=0' ) ) ) . '" rel="bookmark"',
|
|
number_format_i18n( $total_images )
|
|
); ?></p><?php
|
|
else :
|
|
the_excerpt();
|
|
endif;
|
|
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 ( 'link' != $format ) :
|
|
the_title( '<h1 class="entry-title"><a href="' . get_permalink() . '" title="' . esc_attr( sprintf( __( 'Permalink to %s', 'twentyfourteen' ), the_title_attribute( 'echo=0' ) ) ) . '" rel="bookmark">', '</a></h1>' );
|
|
endif;
|
|
?>
|
|
<?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; ?>
|
|
</div><!-- .entry-meta -->
|
|
</header><!-- .entry-header -->
|
|
</article>
|