Hello!
I want to use different shortcodes in a page or posttitle
Total comment count;
function comment_count() {
global $wpdb;
return $wpdb->get_var("SELECT COUNT(*)
FROM $wpdb->comments
WHERE comment_approved = 1");
}
add_shortcode('commentcount', 'comment_count');
And Total post count;
function post_count() {
global $wpdb;
return $wpdb->get_var("SELECT count(id)
FROM $wpdb->posts
WHERE post_type = 'post'
AND post_status = 'publish'");
}
add_shortcode('postcount', 'post_count');
I know I need do something with filters? Can somebody help me with this question?