With this code, you can dynamically show, how many users and posts your blog has, by using the shortcodes
[user_count]
giving out this number: 1
and
[total_posts]
giving out this number: 44
Add this Code to your functions.php, f.ex. via Code Snippets.
function gooloo_total_posts() {
$total = wp_count_posts()->publish;
return $total;
}
add_shortcode('total_posts', 'gooloo_total_posts');
function gooloo_user_count() {
$usercount = count_users();
$result = $usercount['total_users'];
return $result;
}
add_shortcode('user_count', 'gooloo_user_count');
Leave a Reply