I'm trying to display some statistics of my Wordpress site in the footer. One of these statistics is the amount of users that are signed up.
There is a function called count_users()
to display these statistics as show in the Codex: count_users(). But this function seems very server intensive, especially since it will be called on every WordPress page.
I started looking for less server intensive alternative and found one called get_user_count()
Codex: get_user_count(). Unfortunately, this only seems to work on Multisite installations.
Is it possible to enable this and other Multisite functions for regular installations??
set_transient
andget_transient
to cache the result for however long you like so that you are not callingcount_users
on every pageload?