JahanSoft
May 4th, 2017, 21:27
کد زیر را در فایل فانکشن قرار دهید functions.php
function wpb_comment_count() {
$comments_count = wp_count_comments();
$message = 'There are <strong>'. $comments_count->approved . '</strong> comments posted by our users.';
return $message;
}
add_shortcode('wpb_total_comments','wpb_comment_co unt'); add_filter('widget_text','do_shortcode');
کد زیر را هرجا که میخواهید تعداد کامنت ها نمایش داده شود قرار دهید
[wpb_total_comments]
نکته : کلمات انگلیسی را فارسی کنید.
منبع » (http://www.wpbeginner.com/wp-tutorials/how-to-display-the-total-number-of-comments-in-wordpress/)
function wpb_comment_count() {
$comments_count = wp_count_comments();
$message = 'There are <strong>'. $comments_count->approved . '</strong> comments posted by our users.';
return $message;
}
add_shortcode('wpb_total_comments','wpb_comment_co unt'); add_filter('widget_text','do_shortcode');
کد زیر را هرجا که میخواهید تعداد کامنت ها نمایش داده شود قرار دهید
[wpb_total_comments]
نکته : کلمات انگلیسی را فارسی کنید.
منبع » (http://www.wpbeginner.com/wp-tutorials/how-to-display-the-total-number-of-comments-in-wordpress/)