Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*-----------------------------------------------------------------------------------*/
- /* List admins, contributors, editors and authors for contributors template
- /*-----------------------------------------------------------------------------------*/
- function periodic_contributors() {
- global $wpdb;
- $authors = $wpdb->get_results("
- SELECT ID, display_name
- FROM wp_users
- INNER JOIN wp_usermeta
- ON wp_users.ID = wp_usermeta.user_id
- WHERE wp_usermeta.meta_key = 'wp_capabilities'
- AND (wp_usermeta.meta_value
- LIKE '%admin%'
- OR wp_usermeta.meta_value
- LIKE '%contributor%'
- OR wp_usermeta.meta_value
- LIKE '%editor%'
- OR wp_usermeta.meta_value
- LIKE '%author%')
- ORDER BY display_name
- ");
- foreach($authors as $author) {
- echo "<li>";
- echo '<div class="contribute-avatar"';
- echo "<a href=\"" . home_url() ."/author/"; the_author_meta('user_nicename', $author->ID); echo "/\">";
- echo get_avatar($author->ID, '75');
- echo "</a>";
- echo "</div>";
- echo '<div class="contribute-text">';
- echo "<h3><a href=\"". home_url() ."/author/"; the_author_meta('user_nicename', $author->ID); echo "/\">"; the_author_meta('display_name', $author->ID);
- echo "</a></h3>";
- echo "<p>";
- echo the_author_meta('description', $author->ID);
- echo "</p>";
- echo "<p>";
- echo _e('Browse Articles by ','periodic');
- echo "<a class=\"right-arrow\" href=\"". home_url() ."/author/"; the_author_meta('user_nicename', $author->ID); echo "/\">"; the_author_meta('display_name', $author->ID);
- echo "</a>";
- echo "</p>";
- echo "</div>";
- echo "</li>";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement