- 性别
- 保密
- 个人主页
- http://tarr.cn/
- 自我介绍
- 茄咧啡 http://tarr.cn/
- 原始股
- 0 股
- 在线时间
- 18 小时
- 帖子
- 32
- 记录
- 0
- 好友
- 0
- 主题
- 8
- 精华
- 1
- 最后登录
- 2011-2-20
- 注册时间
- 2008-7-28
- 阅读权限
- 20
- UID
- 57579
 
- 金钱
- 137 WPB
- 积分
- 173
|
发表于 2009-2-24 21:10:31
|显示全部楼层
本帖最后由 jookr 于 2009-2-25 07:40 编辑
新安装Wordpress以后
一、给根目录文件
wp-config.php
加以下代码-
- define('WP_POST_REVISIONS', false);//主要作用是让ID连续
复制代码 二、进后台先启用两个插件
wp-pagenavi 分页链接
super-switch 主要作用是让ID连续
三、wp-includes/functions.php
加入以下代码,计算发帖量的(我觉得不是很准确,谁优化好了,请记得发给我一份,谢谢。)- //count 1 day post count1day()
- function count1day()
- {
- global $wpdb;
- $strsql = "SELECT count( ID ) AS c FROM wp_posts WHERE post_date > SUBDATE(NOW(),INTERVAL 1 day)" ;
- $xxooxx = $wpdb->get_var($strsql);
- return $xxooxx;
- }
- //count 1 day post count1day()
- //count 1 week post count1week()
- function count1week()
- {
- global $wpdb;
- $strsql = "SELECT count( ID ) AS c FROM wp_posts WHERE post_date > SUBDATE(NOW(),INTERVAL 1 week)" ;
- $xxooxx = $wpdb->get_var($strsql);
- return $xxooxx;
- }
- //count 1 week post count1week()
- //count post
- function countsend()
- {
- global $wpdb;
- $strsql = "SELECT count( ID ) AS c FROM wp_posts" ;
- $xxooxx = $wpdb->get_var($strsql);
- return $xxooxx;
- }
- //count post
复制代码 四、wp-includes/general-template.php
加入以下代码,内页标题输出带一部分正文.-
- //内页标题输出带一部分正文
- //$title = strip_tags( apply_filters( 'single_post_title', $post->post_title ) );//原代码 替换成以下
- $title = strip_tags( apply_filters( 'single_post_title', $post->post_title ) ).":".strip_tags( apply_filters( 'single_post_content', $post->post_content ) );
- if(strlen($title) > 120)
- $title = mb_substr($title,0,120,'UTF-8')."...";
复制代码 附件下载http://tarr.cn/demo/wordpress-for-microblog.rar
演示见http://tarr.cn/blog/
转载请注明出处:http://tarr.cn/wordpress-for-microblog-twitter.html |
附件: 你需要登录才可以下载或查看附件。没有帐号?注册
-
总评分: 金钱 + 10
查看全部评分
|