WordPress.org

Ready to get started?Download WordPress

Forums

Author Image
WP_User_Query ? (2 posts)

  1. watermelonkid
    Member
    Posted 2 years ago #

    Has anyone used the_author_image() with any success using the relatively new WP_User_Query() ? I've tried a few different approaches. All my other data is populating--just not the image. I've cut out my args just for simplicity of pasting here. Example:

    $wp_user_query = new WP_User_Query($args);
        $authors = $wp_user_query->get_results();
            if (!empty($authors))
                {
                   foreach ($authors as $author)
                   {
                       $author_info = get_userdata($author->ID);
                       echo '<div>';
                       the_author_image(get_userdata($author_info));
                       echo $author_info->first_name.' '.$author_info->last_name.'</li>';
                    }
              }

    http://wordpress.org/extend/plugins/sem-author-image/

  2. watermelonkid
    Member
    Posted 2 years ago #

    Sorry, code should be:

    $wp_user_query = new WP_User_Query($args);
        $authors = $wp_user_query->get_results();
            if (!empty($authors))
                {
                   foreach ($authors as $author)
                   {
                       $author_info = get_userdata($author->ID);
                       echo '<div>';
                       the_author_image($author_info);
                       echo $author_info->first_name.' '.$author_info->last_name.'</li>';
                    }
              }

    It doesn't work either way.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic