Skip to main content
added 17 characters in body
Source Link
ingvi
  • 45
  • 2
  • 5

I'm trying to order the member list by display_namedisplay_name or first name ASC. http://sim.is/sim/felagatal-sim/

This doesn't seem to work. Any pointers out there? :/

$users = get_users(array(
    'role' => 'sm_flagar',
    'orderby' => 'display_name',
    'order' => 'ASC',
));

    foreach ($users as $user) {
        $firstName = get_user_meta($user->ID, 'first_name', true);
        $lastName = get_user_meta($user->ID, 'last_name', true);
            echo '<li><a href="' . $user->user_url . '">' . $firstName . ' ' . $lastName . '</a></li>' . PHP_EOL;
    }

I'm trying to order the member list by display_name or first name ASC. http://sim.is/sim/felagatal-sim/

This doesn't seem to work. Any pointers out there? :/

$users = get_users(array(
    'role' => 'sm_flagar',
    'orderby' => 'display_name',
    'order' => 'ASC',
));

    foreach ($users as $user) {
        $firstName = get_user_meta($user->ID, 'first_name', true);
        $lastName = get_user_meta($user->ID, 'last_name', true);
            echo '<li><a href="' . $user->user_url . '">' . $firstName . ' ' . $lastName . '</a></li>' . PHP_EOL;
    }

I'm trying to order the member list by display_name or first name ASC. http://sim.is/sim/felagatal-sim/

This doesn't seem to work. Any pointers out there? :/

$users = get_users(array(
    'role' => 'sm_flagar',
    'orderby' => 'display_name',
    'order' => 'ASC',
));

    foreach ($users as $user) {
        $firstName = get_user_meta($user->ID, 'first_name', true);
        $lastName = get_user_meta($user->ID, 'last_name', true);
            echo '<li><a href="' . $user->user_url . '">' . $firstName . ' ' . $lastName . '</a></li>' . PHP_EOL;
    }
Source Link
ingvi
  • 45
  • 2
  • 5

Order by first name

I'm trying to order the member list by display_name or first name ASC. http://sim.is/sim/felagatal-sim/

This doesn't seem to work. Any pointers out there? :/

$users = get_users(array(
    'role' => 'sm_flagar',
    'orderby' => 'display_name',
    'order' => 'ASC',
));

    foreach ($users as $user) {
        $firstName = get_user_meta($user->ID, 'first_name', true);
        $lastName = get_user_meta($user->ID, 'last_name', true);
            echo '<li><a href="' . $user->user_url . '">' . $firstName . ' ' . $lastName . '</a></li>' . PHP_EOL;
    }