Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the copy-the-code domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/html/pcx3.com/wp-includes/functions.php on line 6121

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the pb-seo-friendly-images domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/html/pcx3.com/wp-includes/functions.php on line 6121

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the johannes domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/html/pcx3.com/wp-includes/functions.php on line 6121
Display total number of 💬 comments in WordPress - PC✗3
Display total number of 💬 comments in WordPress

Display total number of 💬 comments in WordPress

Add the following code to your active theme’s functions.php file and then add this shortcode [wpm_total_comments] anywhere on your website where you want the total number of comments to display.

/** *Display total number of WordPress comments*/
function wpm_comment_count() { 
$comments_count = wp_count_comments();
$message =  'There are '.  $comments_count->approved . ' comments posted by our visitors.';
return $message; 
} 
add_shortcode('wpm_total_comments','wpm_comment_count');
whoami
Stefan Pejcic
Join the discussion

I enjoy constructive responses and professional comments to my posts, and invite anyone to comment or link to my site.