<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[25510] trunk/src/wp-content/themes/twentyfourteen: Twenty Fourteen: first pass at adding a Contributors page template to highlight authors.</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://core.trac.wordpress.org/changeset/25510">25510</a></dd>
<dt>Author</dt> <dd>lancewillett</dd>
<dt>Date</dt> <dd>2013-09-19 21:33:00 +0000 (Thu, 19 Sep 2013)</dd>
</dl>

<h3>Log Message</h3>
<pre>Twenty Fourteen: first pass at adding a Contributors page template to highlight authors. Props MikeHansenMe, iamtakashi, obenland, and Kuzmanov. See <a href="http://core.trac.wordpress.org/ticket/24863">#24863</a>.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpcontentthemestwentyfourteenfunctionsphp">trunk/src/wp-content/themes/twentyfourteen/functions.php</a></li>
<li><a href="#trunksrcwpcontentthemestwentyfourteenstylecss">trunk/src/wp-content/themes/twentyfourteen/style.css</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunksrcwpcontentthemestwentyfourteencontributorpagephp">trunk/src/wp-content/themes/twentyfourteen/contributor-page.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpcontentthemestwentyfourteencontributorpagephp"></a>
<div class="addfile"><h4>Added: trunk/src/wp-content/themes/twentyfourteen/contributor-page.php (0 => 25510)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-content/themes/twentyfourteen/contributor-page.php                          (rev 0)
+++ trunk/src/wp-content/themes/twentyfourteen/contributor-page.php     2013-09-19 21:33:00 UTC (rev 25510)
</span><span class="lines">@@ -0,0 +1,39 @@
</span><ins>+<?php
+/**
+ * Template Name: Contributor Page
+ *
+ * @package WordPress
+ * @subpackage Twenty_Fourteen
+ */
+
+get_header(); ?>
+
+       <div id="primary" class="content-area">
+               <div id="content" class="site-content full-width" role="main">
+                       <?php
+                               while ( have_posts() ) :
+                                       the_post();
+                       ?>
+
+                       <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
+                               <?php
+                                       the_title( '<header class="entry-header"><h1 class="entry-title">', '</h1></header><!-- .entry-header -->' );
+
+                                       twentyfourteen_list_authors();
+
+                                       edit_post_link( __( 'Edit', 'twentyfourteen' ), '<footer class="entry-meta"><span class="edit-link">', '</span></footer>' );
+                               ?>
+                       </article><!-- #post-## -->
+
+                       <?php
+                                       // If comments are open or we have at least one comment, load up the comment template.
+                                       if ( comments_open() || get_comments_number() )
+                                               comments_template();
+                               endwhile;
+                       ?>
+               </div><!-- #content -->
+       </div><!-- #primary -->
+
+<?php
+get_sidebar();
+get_footer();
</ins><span class="cx">Property changes on: trunk/src/wp-content/themes/twentyfourteen/contributor-page.php
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<ins>+native
</ins><span class="cx">\ No newline at end of property
</span><a id="trunksrcwpcontentthemestwentyfourteenfunctionsphp"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-content/themes/twentyfourteen/functions.php (25509 => 25510)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-content/themes/twentyfourteen/functions.php 2013-09-19 21:00:02 UTC (rev 25509)
+++ trunk/src/wp-content/themes/twentyfourteen/functions.php    2013-09-19 21:33:00 UTC (rev 25510)
</span><span class="lines">@@ -340,7 +340,46 @@
</span><span class="cx"> }
</span><span class="cx"> endif;
</span><span class="cx"> 
</span><ins>+if ( ! function_exists( 'twentyfourteen_list_authors' ) ) :
</ins><span class="cx"> /**
</span><ins>+ * Prints a list of all site contributors who published at least one post.
+ *
+ * @return void
+ */
+function twentyfourteen_list_authors() {
+       $contributor_ids = get_users( array(
+               'fields'  => 'ID',
+               'orderby' => 'post_count',
+               'who'     => 'authors',
+       ) );
+
+       foreach ( $contributor_ids as $contributor_id ) :
+               $post_count = count_user_posts( $contributor_id );
+
+               // Move on if user has not published a post (yet).
+               if ( ! $post_count )
+                       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><!-- .contributor -->
+
+       <?php
+       endforeach;
+}
+endif;
+
+/**
</ins><span class="cx">  * Gets recent formatted posts that are not featured in FC plugin.
</span><span class="cx">  *
</span><span class="cx">  */
</span></span></pre></div>
<a id="trunksrcwpcontentthemestwentyfourteenstylecss"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-content/themes/twentyfourteen/style.css (25509 => 25510)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-content/themes/twentyfourteen/style.css     2013-09-19 21:00:02 UTC (rev 25509)
+++ trunk/src/wp-content/themes/twentyfourteen/style.css        2013-09-19 21:33:00 UTC (rev 25510)
</span><span class="lines">@@ -306,6 +306,7 @@
</span><span class="cx">  *overflow: visible;  /* Corrects inner spacing displayed oddly in IE6/7 */
</span><span class="cx"> }
</span><span class="cx"> button,
</span><ins>+.contributor-posts-link,
</ins><span class="cx"> html input[type="button"],
</span><span class="cx"> input[type="reset"],
</span><span class="cx"> input[type="submit"] {
</span><span class="lines">@@ -323,6 +324,7 @@
</span><span class="cx">  vertical-align: top;
</span><span class="cx"> }
</span><span class="cx"> button:hover,
</span><ins>+.contributor-posts-link:hover,
</ins><span class="cx"> html input[type="button"]:hover,
</span><span class="cx"> input[type="reset"]:hover,
</span><span class="cx"> input[type="submit"]:hover,
</span><span class="lines">@@ -331,9 +333,11 @@
</span><span class="cx"> input[type="reset"]:focus,
</span><span class="cx"> input[type="submit"]:focus {
</span><span class="cx">  background-color: #24890d;
</span><ins>+       color: #fff;
</ins><span class="cx">   cursor: pointer;
</span><span class="cx"> }
</span><span class="cx"> button:active,
</span><ins>+.contributor-posts-link:active,
</ins><span class="cx"> html input[type="button"]:active,
</span><span class="cx"> input[type="reset"]:active,
</span><span class="cx"> input[type="submit"]:active {
</span><span class="lines">@@ -495,6 +499,7 @@
</span><span class="cx"> 
</span><span class="cx"> /* Genericons */
</span><span class="cx"> .search-toggle:before,
</span><ins>+.contributor-posts-link:before,
</ins><span class="cx"> .widget_twentyfourteen_ephemera .widget-title:before {
</span><span class="cx">  display: inline-block;
</span><span class="cx">  -webkit-font-smoothing: antialiased;
</span><span class="lines">@@ -1726,6 +1731,7 @@
</span><span class="cx">  margin: 24px 0 0;
</span><span class="cx">  margin: 2.4rem 0 0;
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> .post-navigation [rel="prev"],
</span><span class="cx"> .post-navigation [rel="next"],
</span><span class="cx"> .image-navigation .previous-image,
</span><span class="lines">@@ -2314,6 +2320,55 @@
</span><span class="cx">  width: 198px;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+
+/* =Contributor Page
+----------------------------------------------- */
+
+.contributor {
+       border-bottom: 1px solid rgba(0, 0, 0, 0.1);
+       -moz-box-sizing: border-box;
+       box-sizing:      border-box;
+       padding: 48px 0;
+       padding: 4.8rem 0;
+}
+.contributor-avatar {
+       float: left;
+       padding: 2px;
+       padding: 0.2rem;
+       border: 1px solid rgba(0, 0, 0, 0.1);
+       margin-right: 30px;
+       margin-right: 3.0rem;
+}
+.contributor-avatar .avatar {
+       vertical-align: middle;
+}
+.contributor-summary {
+       float: left;
+       max-width: 474px;
+       max-width: 47.4rem;
+       width: -webkit-calc(100% - 164px);
+       width:         calc(100% - 164px);
+}
+.contributor-name {
+       font-size: 16px;
+       font-size: 1.6rem;
+       font-weight: 900;
+       line-height: 1.5;
+       margin-bottom: 0;
+       text-transform: uppercase;
+}
+.contributor-bio {
+       color: #767676;
+}
+.contributor-posts-link {
+       display: inline-block;
+}
+.contributor-posts-link:before {
+       content: '\f443';
+       vertical-align: text-bottom;
+}
+
+
</ins><span class="cx"> /* =Media Queries
</span><span class="cx"> ----------------------------------------------- */
</span><span class="cx"> 
</span><span class="lines">@@ -2397,6 +2452,7 @@
</span><span class="cx">  .parent-post-link:before {
</span><span class="cx">          content: '';
</span><span class="cx">  }
</span><ins>+
</ins><span class="cx">   .content-area .featured-post:before,
</span><span class="cx">  .content-area .post-format a:before,
</span><span class="cx">  .content-area .post-format + .entry-date a:before,
</span><span class="lines">@@ -2414,7 +2470,6 @@
</span><span class="cx">          margin: 0 2px 0 0;
</span><span class="cx">          margin: 0 0.2rem 0 0;
</span><span class="cx">          text-transform: none;
</span><del>-               vertical-align: top;
</del><span class="cx">   }
</span><span class="cx">  .content-area .entry-meta > span {
</span><span class="cx">          margin-right: 10px;
</span><span class="lines">@@ -2689,6 +2744,7 @@
</span><span class="cx">  .error404 .content-area .page-header {
</span><span class="cx">          margin: 0 8.03571428% 0 12.5%;
</span><span class="cx">  }
</span><ins>+       .contributor,
</ins><span class="cx">   .content-area .full-width .entry-header,
</span><span class="cx">  .content-area .full-width .entry-content,
</span><span class="cx">  .content-area .full-width footer.entry-meta {
</span><span class="lines">@@ -2907,6 +2963,7 @@
</span><span class="cx">          padding: 0 0 12px;
</span><span class="cx">          padding: 0 0 1.2rem;
</span><span class="cx">  }
</span><ins>+       .contributor,
</ins><span class="cx">   .content-area .full-width .entry-header,
</span><span class="cx">  .content-area .full-width .entry-content,
</span><span class="cx">  .content-area .full-width .page-content,
</span><span class="lines">@@ -3028,6 +3085,7 @@
</span><span class="cx">  .error404 .content-area .page-header {
</span><span class="cx">          margin: 0 8.03571428% 0 12.5%;
</span><span class="cx">  }
</span><ins>+       .contributor,
</ins><span class="cx">   .content-area .full-width .entry-header,
</span><span class="cx">  .content-area .full-width .entry-content,
</span><span class="cx">  .content-area .full-width .page-content,
</span><span class="lines">@@ -3068,6 +3126,7 @@
</span><span class="cx">  .ephemera {
</span><span class="cx">          padding-right: 0;
</span><span class="cx">  }
</span><ins>+       .contributor,
</ins><span class="cx">   .content-area .full-width .entry-header,
</span><span class="cx">  .content-area .full-width .entry-content,
</span><span class="cx">  .content-area .full-width .page-content,
</span></span></pre>
</div>
</div>

</body>
</html>