Created
January 5, 2009 20:36
-
-
Save sproutventure/43534 to your computer and use it in GitHub Desktop.
WP Author Page based on userextra filer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // display all users with usermeta 'featured_author' checked 'yes' | |
global $wpdb, $usermeta; | |
$featured_authors = $wpdb->get_results(" | |
SELECT user.ID, user.user_nicename | |
FROM $wpdb->users user | |
", OBJECT); | |
// loop through authors | |
foreach($featured_authors as $featured_author) { | |
$curauthor = get_userdata( $featured_author->ID ); | |
// select featured authors | |
$val = $usermeta->get($featured_author->ID, "featured_author", true); | |
if ($val == 'Yes'){ | |
// featured authors attributes | |
$name = $curauthor->display_name; | |
endif; | |
{ ?> | |
<!-- Author Loop --> | |
<?php echo get_author_name($featured_author->ID)?> | |
<?php } } } ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment