Guest User

Untitled

a guest
Feb 22nd, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. <?php // display all users with usermeta 'featured_author' checked 'yes'
  2. global $wpdb, $usermeta;
  3. $featured_authors = $wpdb->get_results("
  4. SELECT user.ID, user.user_nicename
  5. FROM $wpdb->users user
  6. ", OBJECT);
  7. // loop through authors
  8. foreach($featured_authors as $featured_author) {
  9. $curauthor = get_userdata( $featured_author->ID );
  10. // select featured authors
  11. $val = $usermeta->get($featured_author->ID, "featured_author", true);
  12. if ($val == 'Yes'){
  13. // featured authors attributes
  14. $name = $curauthor->display_name;
  15. endif;
  16. { ?>
  17. <!-- Author Loop -->
  18. <?php echo get_author_name($featured_author->ID)?>
  19. <?php } } } ?>
Add Comment
Please, Sign In to add comment