• Elena

    (@elenapanzalis)


    Hi,
    I found this code on the web. That was very useful but I need to display the User Comments Count near the Users’ name.
    What can I do?

    $allUsers = get_users('orderby=comment_count&order=DESC');
    
    $users = array();
    
    // Remove subscribers from the list as they won't write any articles
    foreach($allUsers as $currentUser)
    {
    	if(!in_array( 'administrator', $currentUser->roles ))
    	{
    		$users[] = $currentUser;
    	}
    }
    
    foreach($users as $user)
    				{
    <a href="<?php echo get_author_posts_url( $user->ID ); ?>"><?php echo $user->display_name; ?>
    
    <?php echo get_avatar( $user->user_email, '128' ); ?>
    }
  • The topic ‘User comments count’ is closed to new replies.