WordPress使用类插件增加站点统计功能

看到很多wordpress博客在侧边栏上使用的对外的站点统计功能,当然内部数据分析我们一般都是使用“站长统计”或”百度统计“,我是一个亲自动手的爱好者,在网上查询了很多信息,大部分标题都是免插件实现站点统计功能云云,然后把开发者手册里面的调用字段分享出来,然后并没有什么用,因为我们的博客侧边栏根本不能插入PHP代码,我要那些调用字段有何用,我要的是一段直接能够显示站点统计小工具的效果而己,还有些老外编写的巨大的站长分析工具,我们有Google统计和百度统计,这玩意根本不需要,所以求人不如求已,自己动手实现:

一、自己用PHP编写一个小工具

使用开发者手册提供的调用字段编写了一个PHP文件,内容便是站点统计内容,我已经替你写好了,不用你再劳神费力去编写了,当然本人也是借鉴其他人的内容修改完成的,

点左边下载图标下载压缩包,解压后是一个PHP文件。

二、上传PHP文件

将该PHP文件通过FTP工具上传到worpdress的主题文件夹下,你所用主题的根目录下。

三、调用PHP文件

打开主题目录下的 function.php,在最后面插入以下代码:

include("qcgzxw_bktj.php");

如果你的 function.php文件的结尾是?> ,请放在这段代码之前,当然你够任性的话,还可以使用相对地址,将文件存放路径可以自定义include(“相对function.php的路径”);

四、调用小工具

完成以上操作后,你可以在小工具里面看到一个博客统计的小工具,添加到侧边栏或任何你想要的位置就好了。

五、注意

站长和访客看到的小工具显示是不一样的,站长显示了所有信息,而游客只是显示了一些相关信息,有些信息不适合让游客看到。而且,因为没有设置CSS,所以这个方法适用于任何主题。所以我才叫它类插件,千万不可按插件安装的形式去安装,反正你也不会安装成功。

原创文章,转载请注明: 转载自飞月秀

本文链接地址: WordPress使用类插件增加站点统计功能

You May Also Like

About the Author: 楚有才

9 Comments

  1. Thanks for every one of your labor on this web page. Kate really likes making time for internet research and it is obvious why. Almost all know all of the lively medium you offer very useful tips by means of your web blog and in addition encourage response from some other people on the concept plus my girl has been learning a lot of things. Have fun with the rest of the year. You are carrying out a fabulous job.

  2. This is an amazing blog; I was trying to figure out how to keep in contact with your blog until I find out a decent iphone app for reading wordpress blogs. I really wish you to have a good day and keep with the good work!

  3. I simply want to mention I am all new to blogging and certainly savored your blog. Very likely I’m going to bookmark your website . You amazingly have really good articles. Appreciate it for sharing with us your web site.

  4. “Great work! That is the type of information that should be shared around the net. Shame on Google for now not positioning this post higher! Come on over and seek advice from my site . Thank you =)”

  5. “I have realized that in cameras, special receptors help to concentrate automatically. The particular sensors with some digital cameras change in in the area of contrast, while others use a beam with infra-red (IR) light, especially in low light. Higher spec cameras from time to time use a mixture of both systems and could have Face Priority AF where the photographic camera can ‘See’ your face while keeping focused only upon that. Thanks for sharing your notions on this weblog.”

发表评论

电子邮件地址不会被公开。