Ticket #24863: 24863.2.diff
File 24863.2.diff, 2.7 KB (added by , 10 years ago) |
---|
-
wp-content/themes/twentyfourteen/functions.php
464 464 } 465 465 add_filter( 'wp_title', 'twentyfourteen_wp_title', 10, 2 ); 466 466 467 function twentyforteen_author_boxes() { 468 global $wpdb; 469 foreach ( (array) $wpdb->get_results( "SELECT DISTINCT post_author, COUNT(ID) AS count FROM $wpdb->posts WHERE post_type = 'post' AND " . get_private_posts_cap_sql( 'post' ) . " GROUP BY post_author" ) as $row ) { 470 $firstname = get_the_author_meta( 'first_name', $row->post_author ); 471 $lastname = get_the_author_meta( 'last_name', $row->post_author ); 472 $fullname = $firstname . " " . $lastname; 473 $bio = get_the_author_meta( 'description', $row->post_author ); 474 $author_url = home_url( '/author/' ) . get_the_author_meta( 'nicename', $row->post_author ); 475 $post_count = $row->count; 476 $author_avatar = get_avatar( get_the_author_meta( 'email', $row->post_author ), 128 ); 477 ?> 478 <div class="contributors-box"> 479 <?php echo $author_avatar; ?> 480 <div class="contributor-info"> 481 <strong> 482 <?php echo $fullname; ?> 483 </strong> 484 485 <p class="contributor-bio"> 486 <?php echo $bio; ?> 487 <br /> 488 <a class="contributor-button" href="<?php echo $author_url; ?>" title="<?php echo $fullname; ?>"> 489 <?php echo $post_count; ?> Articles 490 </a> 491 </p> 492 </div> 493 </div> 494 <?php 495 } 496 } 497 467 498 /** 468 499 * Implement the Custom Header feature 469 500 * -
wp-content/themes/twentyfourteen/style.css
2261 2261 width: 198px; 2262 2262 } 2263 2263 2264 2265 /* =Contributor Page 2266 ----------------------------------------------- */ 2267 .contributors-box{ 2268 padding: 0 100px; 2269 clear: both; 2270 padding-bottom: 30px; 2271 margin-bottom: 30px; 2272 border-bottom: 1px solid #e7e7e7; 2273 } 2274 .contributors-box img.avatar{ 2275 display: inline-block; 2276 vertical-align: top; 2277 padding: 2px; 2278 border: 1px solid #e7e7e7; 2279 margin-right: 30px; 2280 } 2281 .contributor-info{ 2282 width: 500px; 2283 display: inline-block; 2284 } 2285 .contributor-button{ 2286 display: inline-block; 2287 transition: all 0.2s ease-out 0s; 2288 background-color: #000000; 2289 border: medium none; 2290 border-radius: 2px 2px 2px 2px; 2291 color: #FFFFFF; 2292 font-size: 1.2rem; 2293 font-weight: 700; 2294 line-height: 1; 2295 padding: 1.3rem 3.3rem 1.1rem; 2296 text-transform: uppercase; 2297 vertical-align: top; 2298 } 2299 2264 2300 /* =Media Queries 2265 2301 ----------------------------------------------- */ 2266 2302