W3 Total Cache是wordpress一个很全面很强大的缓存加速插件 用了它之后其他什么优化插件都可以不需要了
它本身支持好几种缓存的方式 一般shared host就是网站空间的话 大概只能选disk缓存方式
我这个是vps 所以可以装php-apc用来缓存 ubuntu下也很方便 直接 sudo apt-get install php-apc就可以
类似的 依然还会有静态链接和nginx的配合问题 其实W3 Total Cache目前的版本已经支持nginx
配置好后 会在服务器wordpress的根目录下生成一个nginx.conf文件 所以需要做的只是把这段规则加到nginx的配置文件里就行
比如我nginx的配置文件是 /etc/nginx/sites-enabled/default 只需要在
server {
}
段里面location / 后面加上一段 变成这样就可以了
location / {
# First attempt to serve request as file, then
# as directory, then fall back to index.html
try_files $uri $uri/ /index.html;
if (!-e $request_filename) {
rewrite ^([_0-9a-zA-Z-]+)?(/wp-.*) $2 last;
rewrite ^([_0-9a-zA-Z-]+)?(/.*.php)$ $2 last;
rewrite ^ /index.php last;
}
if (-f $request_filename) {
expires 30d;
break;
}
if (!-e $request_filename) {
rewrite ^(.+)$ /index.php?q=$1 last;
}
}
include /var/www/wordpress/nginx.conf;
/var/www/wordpress相应改成wordpress文件的目录就行




原来wordpress2.7之后就自带了thread comments了
九月 6th, 2009 | Posted by Daniel in 术业 - (2 Comments)怪不得找了几个plugin都不能用 看来wordpress从2.7以后改动还是不少
稍微修改了一下这个Fervens A模板 让它能够正确支持自带的thread comment方法
主要参考的是这篇文章
Migrating Plugins and Themes to 2.7/Enhanced Comment Display
关键函数就是那个 wp_list_comments 调用callback函数来显示自定义的comment格式
最简单的用法比如
wp_list_comments('type=comment&callback=mytheme_comment');然后在functions.php里写一下mytheme_comment函数即可
2.8, fervens a, php, template, thread comments, wordpress