How can I show how many questions?

5.12K viewsGeneral
0

Hi there,

here is another question, hope this has response ; )

How can I show in a widget area ‘how many Questions’ have been published?

Thank you

And the number of Users with a certain Role?

0

You can use this function for getting total published questions:

ap_total_published_questions()

For counting users, you can try this:

$result = count_users();
foreach($result['avail_roles'] as $role => $count){
    if( 'ap_participant' == $role ) echo $count;
}

None of the above…
Probably I’m missing some code before (I’m not a coder)
Thank you anyway

I did it work!
Count users works perfect but
Count Total questions shows a WRONG number (they are 11 and it shows 1 (1 is published by a specific Role)… How to show ALL?
Thank you again