Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor Champ Camba

    (@champsupertramp)

    Thread Starter andreasml

    (@andreasml)

    Hi @champsupertramp

    Thank you for your quick response. I would appreciate it if you gave me some details on how to use the core function.

    Regards

    Andreas

    Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @andreasml

    You can create a shortcode with the function so that you can add it to a page.

    Here’s a sample shortcode:

    add_shortcode("um_total_members", function(){
    
        $count_users = count_users();
    
        return $count_users['total_users'];
     });

    Usage:
    [um_total_members]

    The above shortcode will display the total number of users of your site. If you want to display the total users of a specific role then you will have to change $count_users['total_users'] to $count_users['avail_roles']['subscriber']

    Regards,

    Plugin Contributor Champ Camba

    (@champsupertramp)

    Hey there!

    ..This thread has been inactive for a while so we’re going to go ahead and mark it Resolved…Please feel free to re-open this thread by changing the Topic Status to ‘Not Resolved’ if any other questions come up and we’d be happy to help… ??

    Regards,

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Display total number of members by default’ is closed to new replies.