Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $args = array(
- 'role' => 'Author',
- 'meta_key' => 'order-number',
- 'orderby' => 'order-number',
- 'order' => 'asc',
- );
- $wp_user_query = new WP_User_Query($args);
- $authors = $wp_user_query->get_results();
- if (!empty($authors))
- {
- echo '<div style="float:left;">';
- foreach ($authors as $author)
- {
- $author_info = get_userdata($author->ID);
- echo '<div class="post team-member"><div class="image">';
- echo get_avatar( $author_info->ID, 91 );
- echo '</div>';
- echo '<div class="content"><div class="title"><a href="/author/' . $author_info->user_login . '">' . $author_info->user_firstname . ' ' . $author_info->user_lastname . '</a></div>';
- echo '' . substr( get_the_author_meta('user_description',$author_info->ID) , 0 , 100 ) . '...';
- echo '</div></div>';
- }
- echo '</div>';
- } else {
- echo 'No authors found';
- }
- ?>
- <?php
- global $wpdb; //Ignore this line if you're not within a function
- $order = $wpdb->get_results("SELECT DISTINCT user_id FROM $wpdb->usermeta WHERE meta_key='order-number' ORDER BY meta_value ASC", "ARRAY_N");
- $authors = array();
- foreach($order as $aid)
- $authors[] = new WP_User($aid[0]);
- if (!empty($authors))
- {
- echo '<div style="float:left;">';
- foreach ($authors as $author)
- {
- $author_info = get_userdata($author->ID);
- echo '<div class="post team-member"><div class="image">';
- echo get_avatar( $author_info->ID, 91 );
- echo '</div>';
- echo '<div class="content"><div class="title"><a href="/author/' . $author_info->user_login . '">' . $author_info->user_firstname . ' ' . $author_info->user_lastname . '</a></div>';
- echo '' . substr( get_the_author_meta('user_description',$author_info->ID) , 0 , 100 ) . '...';
- echo '</div></div>';
- }
- echo '</div>';
- } else {
- echo 'No authors found';
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement