get_var("SELECT COUNT(ID) FROM $wpdb->posts WHERE post_status = 'publish'"); echo $totalposts; } function get_totalcomments() { global $wpdb; $totalcomments = $wpdb->get_var("SELECT COUNT(comment_ID) FROM $wpdb->comments WHERE comment_approved = '1'"); echo $totalcomments; } ?> get_col("SELECT c.post_id FROM {$wpdb->post2cat} c INNER JOIN {$wpdb->posts} p ON c.post_id = p.id WHERE c.category_id = $idcat AND p.post_status='$post_status'"); $number=count($result); echo $number; } ?>