Advertisement
Fask

List Author Wordpress Functions

Mar 14th, 2011
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.48 KB | None | 0 0
  1. function contributors() {
  2. global $wpdb;
  3.  
  4. $authors = $wpdb->get_results("SELECT ID, user_nicename from $wpdb->users WHERE display_name <> 'admin' ORDER BY display_name");
  5.  
  6. $authors_per_page = 10;
  7. $page = isset( $_GET['cpage'] ) ? abs( (int) $_GET['cpage'] ) : 1;
  8.  
  9. echo paginate_links( array(
  10.     'base' => add_query_arg( 'cpage', '%#%' ),
  11.     'format' => '',
  12.     'prev_text' => __('«'),
  13.     'next_text' => __('»'),
  14.     'total' => ceil($total / $authors_per_page),
  15.     'current' => $page
  16. ));
  17.  
  18. foreach ($authors as $author ) {
  19.  
  20. echo "<li>";
  21. echo "<a href=\"".get_bloginfo('url')."/author/";
  22. the_author_meta('user_nicename', $author->ID);
  23. echo "/\">";
  24. echo get_avatar($author->ID);
  25. echo "</a>";
  26. echo '<div>';
  27. echo "<a href=\"".get_bloginfo('url')."/author/";
  28. the_author_meta('user_nicename', $author->ID);
  29. echo "/\">";
  30. the_author_meta('display_name', $author->ID);
  31. echo "</a>";
  32. echo "<br />";
  33. echo "SitoWeb: <a href=\"";
  34. the_author_meta('user_url', $author->ID);
  35. echo "/\" target='_blank'>";
  36. the_author_meta('user_url', $author->ID);
  37. echo "</a>";
  38. echo "<br />";
  39. echo "Twitter: <a href=\"http://twitter.com/";
  40. the_author_meta('twitter', $author->ID);
  41. echo "\" target='_blank'>";
  42. the_author_meta('twitter', $author->ID);
  43. echo "</a>";
  44. echo "<br />";
  45. echo "<a href=\"".get_bloginfo('url')."/author/";
  46. the_author_meta('user_nicename', $author->ID);
  47. echo "/\">Visita il Profilo di ";
  48. the_author_meta('display_name', $author->ID);
  49. echo "</a>";
  50. echo "</div>";
  51. echo "</li>";
  52. }
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement