Twenty Fourteen: first pass at improving responsive patterns and allowing for a full-width layout when no secondary sidebar is present. Props iamtakashi, see #25332.
Built from https://develop.svn.wordpress.org/trunk@25519 git-svn-id: http://core.svn.wordpress.org/trunk@25439 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
9151227edf
commit
980b81f0b1
|
@ -40,7 +40,7 @@ if ( post_password_required() )
|
|||
wp_list_comments( array(
|
||||
'style' => 'ol',
|
||||
'short_ping' => true,
|
||||
'avatar_size'=> 42,
|
||||
'avatar_size'=> 34,
|
||||
) );
|
||||
?>
|
||||
</ol><!-- .comment-list -->
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
get_header(); ?>
|
||||
|
||||
<div id="primary" class="content-area">
|
||||
<div id="content" class="site-content full-width" role="main">
|
||||
<div id="content" class="site-content" role="main">
|
||||
<?php
|
||||
while ( have_posts() ) :
|
||||
the_post();
|
||||
|
|
|
@ -9,23 +9,21 @@
|
|||
*/
|
||||
?>
|
||||
|
||||
<div class="featured-content-wrapper">
|
||||
<div id="featured-content" class="featured-content">
|
||||
<div id="featured-content" class="featured-content">
|
||||
|
||||
<?php
|
||||
do_action( 'twentyfourteen_featured_posts_before' );
|
||||
<?php
|
||||
do_action( 'twentyfourteen_featured_posts_before' );
|
||||
|
||||
$featured_posts = twentyfourteen_get_featured_posts();
|
||||
foreach ( (array) $featured_posts as $order => $post ) :
|
||||
setup_postdata( $post );
|
||||
$featured_posts = twentyfourteen_get_featured_posts();
|
||||
foreach ( (array) $featured_posts as $order => $post ) :
|
||||
setup_postdata( $post );
|
||||
|
||||
get_template_part( 'content', 'featured-post' );
|
||||
endforeach;
|
||||
get_template_part( 'content', 'featured-post' );
|
||||
endforeach;
|
||||
|
||||
do_action( 'twentyfourteen_featured_posts_after' );
|
||||
do_action( 'twentyfourteen_featured_posts_after' );
|
||||
|
||||
wp_reset_postdata();
|
||||
?>
|
||||
wp_reset_postdata();
|
||||
?>
|
||||
|
||||
</div><!-- .featured-content -->
|
||||
</div><!-- .featured-content-wrapper -->
|
||||
</div><!-- #featured-content .featured-content -->
|
||||
|
|
|
@ -8,42 +8,37 @@
|
|||
|
||||
get_header(); ?>
|
||||
|
||||
<div class="front-page-content-wrapper">
|
||||
<div class="front-page-content-main">
|
||||
<div class="front-page-content-wrapper">
|
||||
|
||||
<?php if ( twentyfourteen_has_featured_posts() ) : ?>
|
||||
<?php get_template_part( 'featured-content' ); ?>
|
||||
<?php endif; ?>
|
||||
<?php
|
||||
if ( twentyfourteen_has_featured_posts() )
|
||||
get_template_part( 'featured-content' );
|
||||
?>
|
||||
|
||||
<div class="front-page-content-area">
|
||||
<div id="primary" class="content-area no-sidebar">
|
||||
<div id="content" class="site-content" role="main">
|
||||
<?php
|
||||
if ( have_posts() ) :
|
||||
while ( have_posts() ) :
|
||||
the_post();
|
||||
|
||||
<div id="primary" class="content-area no-sidebar">
|
||||
<div id="content" class="site-content" role="main">
|
||||
<?php
|
||||
if ( have_posts() ) :
|
||||
while ( have_posts() ) :
|
||||
the_post();
|
||||
get_template_part( 'content', get_post_format() );
|
||||
|
||||
get_template_part( 'content', get_post_format() );
|
||||
comments_template();
|
||||
endwhile;
|
||||
twentyfourteen_paging_nav();
|
||||
|
||||
comments_template();
|
||||
endwhile;
|
||||
twentyfourteen_paging_nav();
|
||||
else :
|
||||
get_template_part( 'content', 'none' );
|
||||
|
||||
else :
|
||||
get_template_part( 'content', 'none' );
|
||||
endif;
|
||||
?>
|
||||
</div><!-- #content .site-content -->
|
||||
</div><!-- #primary .content-area -->
|
||||
|
||||
endif;
|
||||
?>
|
||||
</div><!-- #content .site-content -->
|
||||
</div><!-- #primary .content-area -->
|
||||
<?php get_sidebar( 'ephemera' ); ?>
|
||||
|
||||
<?php get_sidebar( 'ephemera' ); ?>
|
||||
|
||||
</div><!-- .front-page-content-area -->
|
||||
|
||||
</div><!-- .front-page-content-main -->
|
||||
</div><!-- .front-page-content-wrapper -->
|
||||
</div><!-- .front-page-content-wrapper -->
|
||||
|
||||
<?php
|
||||
get_sidebar();
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
get_header(); ?>
|
||||
|
||||
<div id="primary" class="content-area">
|
||||
<div id="content" class="site-content full-width" role="main">
|
||||
<div id="content" class="site-content" role="main">
|
||||
<?php
|
||||
while ( have_posts() ) :
|
||||
the_post();
|
||||
|
|
|
@ -99,13 +99,13 @@ endif; // twentyfourteen_setup
|
|||
add_action( 'after_setup_theme', 'twentyfourteen_setup' );
|
||||
|
||||
/**
|
||||
* Adjusts content_width value for full width and attachment templates.
|
||||
* Adjusts content_width value for full-width and attachment templates.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function twentyfourteen_content_width() {
|
||||
if ( is_page_template( 'full-width-page.php' ) || is_attachment() )
|
||||
$GLOBALS['content_width'] = 895;
|
||||
$GLOBALS['content_width'] = 810;
|
||||
}
|
||||
add_action( 'template_redirect', 'twentyfourteen_content_width' );
|
||||
|
||||
|
@ -361,17 +361,19 @@ function twentyfourteen_list_authors() {
|
|||
continue;
|
||||
?>
|
||||
|
||||
<div class="contributor clear">
|
||||
<div class="contributor-avatar"><?php echo get_avatar( $contributor_id, 132 ); ?></div>
|
||||
<div class="contributor-summary">
|
||||
<h2 class="contributor-name"><?php echo get_the_author_meta( 'display_name', $contributor_id ); ?></h2>
|
||||
<p class="contributor-bio">
|
||||
<?php echo get_the_author_meta( 'description', $contributor_id ); ?>
|
||||
</p>
|
||||
<a class="contributor-posts-link" href="<?php echo esc_url( get_author_posts_url( $contributor_id ) ); ?>">
|
||||
<?php printf( _n( '%d Article', '%d Articles', $post_count, 'twentyfourteen' ), $post_count ); ?>
|
||||
</a>
|
||||
</div>
|
||||
<div class="contributor">
|
||||
<div class="contributor-info clear">
|
||||
<div class="contributor-avatar"><?php echo get_avatar( $contributor_id, 132 ); ?></div>
|
||||
<div class="contributor-summary">
|
||||
<h2 class="contributor-name"><?php echo get_the_author_meta( 'display_name', $contributor_id ); ?></h2>
|
||||
<p class="contributor-bio">
|
||||
<?php echo get_the_author_meta( 'description', $contributor_id ); ?>
|
||||
</p>
|
||||
<a class="contributor-posts-link" href="<?php echo esc_url( get_author_posts_url( $contributor_id ) ); ?>">
|
||||
<?php printf( _n( '%d Article', '%d Articles', $post_count, 'twentyfourteen' ), $post_count ); ?>
|
||||
</a>
|
||||
</div><!-- .contributor-summary -->
|
||||
</div><!-- .contributor-info -->
|
||||
</div><!-- .contributor -->
|
||||
|
||||
<?php
|
||||
|
@ -456,18 +458,20 @@ add_action( 'pre_get_posts', 'twentyfourteen_pre_get_posts' );
|
|||
* Adds body classes to denote:
|
||||
* 1. Single or multiple authors.
|
||||
* 2. Index views.
|
||||
* 3. Full-width content layout.
|
||||
*
|
||||
* @param array $classes A list of existing body class values.
|
||||
* @return array The filtered body class list.
|
||||
*/
|
||||
function twentyfourteen_body_classes( $classes ) {
|
||||
// Adds a class of group-blog to blogs with more than 1 published author
|
||||
if ( is_multi_author() ) {
|
||||
if ( is_multi_author() )
|
||||
$classes[] = 'group-blog';
|
||||
}
|
||||
if ( is_archive() || is_search() || is_home() ) {
|
||||
|
||||
if ( is_archive() || is_search() || is_home() )
|
||||
$classes[] = 'list-view';
|
||||
}
|
||||
|
||||
if ( is_page_template( 'full-width-page.php' ) || is_page_template( 'contributor-page.php' ) || is_attachment() )
|
||||
$classes[] = 'full-width';
|
||||
|
||||
return $classes;
|
||||
}
|
||||
|
|
|
@ -6,11 +6,13 @@
|
|||
* @subpackage Twenty_Fourteen
|
||||
*/
|
||||
|
||||
$metadata = wp_get_attachment_metadata();
|
||||
|
||||
get_header();
|
||||
?>
|
||||
|
||||
<section id="primary" class="content-area image-attachment">
|
||||
<div id="content" class="site-content full-width" role="main">
|
||||
<div id="content" class="site-content" role="main">
|
||||
|
||||
<?php while ( have_posts() ) : the_post(); ?>
|
||||
|
||||
|
@ -19,7 +21,6 @@ get_header();
|
|||
<?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
|
||||
|
||||
<div class="entry-meta">
|
||||
<?php $metadata = wp_get_attachment_metadata(); ?>
|
||||
|
||||
<span class="entry-date"><time class="entry-date" datetime="<?php echo esc_attr( get_the_date( 'c' ) ); ?>"><?php echo esc_html( get_the_date() ); ?></time></span>
|
||||
|
||||
|
@ -70,8 +71,10 @@ get_header();
|
|||
</article><!-- #post-## -->
|
||||
|
||||
<nav id="image-navigation" class="navigation image-navigation">
|
||||
<div class="nav-links">
|
||||
<?php previous_image_link( false, __( '<div class="previous-image">Previous Image</div>', 'twentyfourteen' ) ); ?>
|
||||
<?php next_image_link( false, __( '<div class="next-image">Next Image</div>', 'twentyfourteen' ) ); ?>
|
||||
</div><!-- .nav-links -->
|
||||
</nav><!-- #image-navigation -->
|
||||
|
||||
<?php comments_template(); ?>
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue