Top users

10.46K viewsGeneraltheme users users-list
0

Hi Rahul,
I love the plugin so far and really appreciate what you’re doing.
Rahul, I want to show top users based on reputation on my website but I did not find the right code on your website or in support section. For some reason I can’t change the design of my website so is it possible to have that functionality on cutom theme instead of Askbug theme.
Any help would be highly appreciated.
Thanks

Answered question
0

Hello Kanika,
Thanks for your feedback, here is the code which will return an array of top users:

$user_args = array(
  'ap_query'     => true,
  'role__not_in' => [ 'administrator', 'ap_moderator' ],
  'number'       => $number,
);
 $ap_user_query = get_users( $user_args );

Posted new comment

Hi Rahul,
I’ve added the code that I found on your website’s support section, it was a widget, I implemented the code in functions.php of my website, Right now its showing the top users section but the output is wrong. it’s only showing last 5 registered users instead of based on their reputation. can you please check and advise the correct solutions.

https://www.elearningchatter.com/home you can view it at the right hand side bar.

Thanks

May be some bug. I have added it to development list here: https://github.com/anspress/anspress/issues/442