I want to list all the users of my site and the amount of posts each user has.
So far I have the function below, but I don't know how to pull in each user's ID to use in the count_user_posts...
<ul> <?php foreach ( get_users('order=DESC&orderby=post_count') as $user ) : ?> <li style="color:#fff;"><span style="font-weight:bold;"> <?php echo $user->display_name; ?></span> as <?php echo $user->user_nicename; ?> (<?php echo $user->post_count; ?> Posts)<br /> <?php echo 'Posts made: ' . count_user_posts(1); ?> </li><br /> <?php endforeach; ?> </ul>
I have foreach function going, but count_user_posts requires an integer I don't pull in each individual user ID to grab their post amount.
I would appreciate some help with this. I know it's probably something simple... I'm kind of new to php :D. Thanks a lot.