| | 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 | <button class="contributor-button" href="<?php echo $author_url; ?>" title="<?php echo $fullname; ?>"> |
| | 488 | <?php echo $post_count; ?> Articles |
| | 489 | </button> |
| | 490 | </p> |
| | 491 | </div> |
| | 492 | </div> |
| | 493 | <?php |
| | 494 | } |
| | 495 | } |
| | 496 | |