WordPress程序采集文章并设置特色图片 26 April 2012 13:56 Thursday by 小屋 浏览(209)

WordPress的采集插件挺多, 功能也很强大。但是如果要折腾,还是自己写 :D

下面是我的采集插件里的几个关键函数:

匹配函数(经测试效率最好的一个)

/**
 * 获取第一个匹配的内容
 *
 * @author        Copyright (c) <http://sjolzy.cn>
 * @param        string    $str    内容
 * @param        string    $start    起始匹配
 * @param        string    $end    中止匹配
 * @return        string
 */
private function strCut($str, $start, $end){
    $content = strstr( $str, $start );
    $content = substr( $content, strlen( $start ), strpos( $content, $end ) - strlen( $start ) );
    return $content;
}

取出所有匹配的内容

/**
 * 获取所有匹配的内容

阅读全文>>

wordpress子站间相互调用查询 24 April 2012 15:25 Tuesday by小屋 浏览(132)

Wordpress站点ID

Wordpress的多站点模式常常有子站互相调用的需要, 查了下, 好在Wp有带子站站点互相切换的函数.

阅读全文>>

Wordpress文章URL优化,seo优化 19 May 2011 16:18 Thursday by小屋 浏览(812)

 

Wordpress有自定义URL的机制来进行URL优化  ,可以自由设定Wordpress  文章的URL地址。

如,http://sjolzy.cn/Article-URL-Wordpress-optimization-seo-optimization.html

这个URL组成形式为:http://域名/文章标题.html

实现方法:后台 settings > Permalinks > Common settings

选择Custom Structure:填入/%postname%.html

或者多一级目录形式的:/%category%/%postname%.html

这样就能对Wordpress博客的文章进行URL优化了,从而达到seo优化  效果。。

阅读全文>>

Wordpress出现403 Forbidden错误 15 April 2011 16:35 Friday by小屋 浏览(1352)

Wordpress 固定链接设置链接形式为非默认的形式保存更改后,访问前台出现403 Forbidden的错误

Forbidden

You don't have permission to access / on this server.

这个错误后的解决办法是:

在生成了的.htaccess文件 里增加“Options +FollowSymLinks”这句内容即可(系统rewrite已开启的前提)。

如:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On

阅读全文>>