I'm trying to display a list of authors by their last name. I can get the list to display but as yet I don't seem to be able to order the list by last name. Any help would be greatly appreciated. Josh
<?php
$args = array(
// search only for Authors role
// order results by display_name
'orderby' => 'meta_value',
'meta_key ' => 'last_name',
'role' => 'guest-teacher'
// check for two meta_values
);
// Create the WP_User_Query object
$wp_user_query = new WP_User_Query($args);
// Get the results
$authors = $wp_user_query->get_results();
// Check for results
if (!empty($authors))
{
echo '<ul class="permanent">';
// loop trough each author
foreach ($authors as $author)
{
// get all the user's data
$author_info = get_userdata($author->ID);
$url = get_author_posts_url($author->ID);
?>
<h3><a href="<?php echo $url; ?>"><?php echo $author_info->last_name; ?> </a></h3>
<?php
}
echo '</ul>';
} else {
}
?>