wordpress博客统计
分类:折腾日期:2013-06-19 - 11:51:06作者:老谢
文章:<?php $count_posts = wp_count_posts(); echo $published_posts = $count_posts->publish; ?> 篇
浏览:<?php get_totalviews(true, true, true); ?> 次
页面:<?php $count_pages = wp_count_posts('page'); echo $page_posts = $count_pages->publish; ?> 个
草稿:<?php $count_posts = wp_count_posts(); echo $draft_posts = $count_posts->draft; ?> 篇
分类:<?php echo $count_categories = wp_count_terms('category'); ?> 个
标签:<?php echo $count_tags = wp_count_terms('post_tag'); ?> 个
会员:<?php $users = $wpdb->get_var("SELECT COUNT(ID) FROM $wpdb->users"); echo $users; ?> 个
链接:<?php $link = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->links WHERE link_visible = 'Y'"); echo $link; ?> 个
评论:<?php $total_comments = get_comment_count(); echo $total_comments['approved'];?> 条
浏览:<?php get_totalviews(true, true, true); ?> 次
运行:<?php echo floor((time()-strtotime("2010-07-03"))/86400);?>天
更新:<?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; ?> |
文章:<?php $count_posts = wp_count_posts(); echo $published_posts = $count_posts->publish; ?> 篇
浏览:<?php get_totalviews(true, true, true); ?> 次
页面:<?php $count_pages = wp_count_posts('page'); echo $page_posts = $count_pages->publish; ?> 个
草稿:<?php $count_posts = wp_count_posts(); echo $draft_posts = $count_posts->draft; ?> 篇
分类:<?php echo $count_categories = wp_count_terms('category'); ?> 个
标签:<?php echo $count_tags = wp_count_terms('post_tag'); ?> 个
会员:<?php $users = $wpdb->get_var("SELECT COUNT(ID) FROM $wpdb->users"); echo $users; ?> 个
链接:<?php $link = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->links WHERE link_visible = 'Y'"); echo $link; ?> 个
评论:<?php $total_comments = get_comment_count(); echo $total_comments['approved'];?> 条
浏览:<?php get_totalviews(true, true, true); ?> 次
运行:<?php echo floor((time()-strtotime("2010-07-03"))/86400);?>天
更新:<?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; ?>
来自网络:在侧边栏调用wordpress博客统计,WordPress 博客首页添加站点统计显示
好复杂
@傅小黑 不复杂吧,直接就拿去用了
循着pingback过来看看。很勤奋的博主,支持,常联系。
模板一般都自带这功能吧?
@骑行领域 用过的很多模板都没有
流量大的展示起来强
@软件小品 刷新一次就算一次访问,意义不大。。
很有用,收藏了,呵呵。
不错 拿来就能用
嘿嘿,不客气了,果断拿走了