有的时候这些功能蛮不错的
1、日志总数:
<code>
<?php $count_posts = wp_count_posts(); echo $published_posts = $count_posts->publish;?>
</code>
<?php $count_posts = wp_count_posts(); echo $published_posts = $count_posts->publish;?>
</code>
2、草稿数目:
<code>
<?php $count_posts = wp_count_posts(); echo $draft_posts = $count_posts->draft; ?>
</code>
<?php $count_posts = wp_count_posts(); echo $draft_posts = $count_posts->draft; ?>
</code>
3、评论总数:
<code>
<?php echo $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->comments");?>
</code>
<?php echo $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->comments");?>
</code>
4、建站天数:
<code>
<?php echo floor((time()-strtotime("2012-11-22"))/86400); ?>
</code>
<?php echo floor((time()-strtotime("2012-11-22"))/86400); ?>
</code>
2012-11-22
为你的建站日期
5、标签总数:
<code>
<?php echo $count_tags = wp_count_terms('post_tag'); ?></code>
<?php echo $count_tags = wp_count_terms('post_tag'); ?></code>
6、页面总数:
<code>
<?php $count_pages = wp_count_posts('page'); echo $page_posts = $count_pages->publish; ?>
</code>
<?php $count_pages = wp_count_posts('page'); echo $page_posts = $count_pages->publish; ?>
</code>
7、分类总数:
<code>
<?php echo $count_categories = wp_count_terms('category'); ?>
</code>
<?php echo $count_categories = wp_count_terms('category'); ?>
</code>
8、链接总数:
<code>
<?php $link = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->links WHERE link_visible = 'Y'"); echo $link; ?>
</code>
<?php $link = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->links WHERE link_visible = 'Y'"); echo $link; ?>
</code>
9、用户总数:
<code>
<?php $users = $wpdb->get_var("SELECT COUNT(ID) FROM $wpdb->users"); echo $users; ?>
</code>
<?php $users = $wpdb->get_var("SELECT COUNT(ID) FROM $wpdb->users"); echo $users; ?>
</code>
10、最后更新:
<code>
<?php $last = $wpdb->get_results("SELECT MAX(post_modified) AS MAX_m FROM $wpdb->posts WHERE (post_type = 'post' OR post_type = 'page') AND (post_status = 'publish' OR post_status = 'private')");$last = date('Y-n-j', strtotime($last[0]->MAX_m));echo $last; ?></code>
<?php $last = $wpdb->get_results("SELECT MAX(post_modified) AS MAX_m FROM $wpdb->posts WHERE (post_type = 'post' OR post_type = 'page') AND (post_status = 'publish' OR post_status = 'private')");$last = date('Y-n-j', strtotime($last[0]->MAX_m));echo $last; ?></code>