Treehouse: Grow your CSS skills. Land your dream job.

WordPress: Querying list_authors or Users

  • # May 14, 2012 at 11:19 am

    So I’ve been trying to create a template that will create a list of user names (only subscribers), their email address, and web address and I’m having no luck. I’ve been using the following code but still nothing is showing up.

    < ?php
    $args = array();
    $args[0] = 'user_firstname';
    $args[1] = 'user_lastname';
    $args[2] = 'user_email';
    $args[3] = 'user_url';?>
    < ?php $wp_user_search = new WP_User_Query( array( 'role' => 'subscriber', 'fields' => $args ) ); ?>
    < ?php $subscribers = $wp_user_search->get_results(); ?>

    any help would be appreciated.
    Thanks in advance

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.