| | 16 | function twentyforteen_author_boxes() { |
| | 17 | global $wpdb; |
| | 18 | foreach ( (array) $wpdb->get_results( "SELECT DISTINCT post_author FROM $wpdb->posts WHERE post_type = 'post' AND " . get_private_posts_cap_sql( 'post' ) . " GROUP BY post_author" ) as $row ) { |
| | 19 | $firstname = get_the_author_meta( 'first_name', $row->post_author ); |
| | 20 | $lastname = get_the_author_meta( 'last_name', $row->post_author ); |
| | 21 | $fullname = $firstname . " " . $lastname; |
| | 22 | $bio = get_the_author_meta( 'description', $row->post_author ); |
| | 23 | $author_url = home_url( '/author/' ) . get_the_author_meta( 'nicename', $row->post_author ); |
| | 24 | $author_avatar = get_avatar( get_the_author_meta( 'email', $row->post_author ), 128 ); |
| | 25 | ?> |
| | 26 | <div class="contributors-box"> |
| | 27 | <div class="contributor-info"> |
| | 28 | <h3> |
| | 29 | <a href="<?php echo $author_url; ?>" title="<?php echo $fullname; ?>"><?php echo $fullname; ?></a> |
| | 30 | </h3> |
| | 31 | <?php echo $author_avatar; ?>" |
| | 32 | <p class="contributor-bio"><?php echo $bio; ?></p> |
| | 33 | <p class="contributor-posts"><a href="<?php echo $author_url; ?>" title="<?php echo $fullname; ?>">Read Articles</a></p> |
| | 34 | </div> |
| | 35 | </div> |
| | 36 | <?php |
| | 37 | } |
| | 38 | } |
| | 39 | |
| | 40 | |