Put this code anywhere on your wordpress page
A small code but fun for wordpress site ;)
8
Put this code anywhere on your wordpress page
Demo : Let's join Gameonline9 at my signature
Code:
<?php
function Statistic($id)
{ global $wpdb;
if($id==0){
$num_posts = $wpdb->get_var("SELECT COUNT(ID) FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish'");
if ($num_posts > 0) $num_posts = number_format($num_posts);
echo $num_posts;
return $num_posts;
}
if($id==1)
{
$num_comments = $wpdb->get_var("SELECT COUNT(comment_ID) FROM $wpdb->comments WHERE comment_approved = '1′");
if ($num_comments > 0) $num_comments = number_format($num_comments);
echo $num_comments;
return $num_comments;
}
if($id==2)
{$num_played = $wpdb->get_var("SELECT SUM( meta_value ) FROM $wpdb->postmeta WHERE meta_key = 'views'");
if ($num_played > 0) $num_played = number_format($num_played);
echo $num_played;
return $num_played;
}
}
?>
<b> Total: <?php Statistic(0);?> game. <?php Statistic(1);?> Comments. <?php Statistic(2);?> played on gameonline9.com</b> - Walter White
- bappy007
- BaMoon
- alanabowe
- BaMoon
- Walter White
- [1] reply
- BaMoon
Next Topics on Trending Feed
-
8