WP 2.1 和 ELA 的兼容性问题

症状:在 WP 2.1 中,ELA 会把新建立的页面当成文章显示出来

那么为什么会出现这种情况呢?因为 WP 2.1 把数据库结构作了调整,以前区分文章和页面是用 post_status 这个 field 的值。如果是 post_status = ‘publish’ 那就是文章,如果 post_status = ’static’ 那说明这是页面。而到了 WP 2.1 上,页面的 post_status 也变成 ‘publish’ 了,区分文章还是页面用 post_type 判断,post_type = ‘post’ 为文章,post_type = ‘page’ 为页面。可 ELA 不知道这点,它还是按老方法来判断,当然会造成误判了。

修复方法:
在/plugins/af-extended-live-archive/路径下的
af-extended-live-archive-include.php和af-extended-live-archive.php中
寻找

p.post_status = 'publish'

替换为

post_type = 'post' AND post_status = 'publish'

p.post_status = ‘publish’ 这种,替换后应为 p.post_type = ‘post’ AND p.post_status = ‘publish’,而不是 p.post_type = ‘post’ AND post_status = ‘publish’

可以从这里下载修改后的文件。

Leave a comment

Please be polite and on topic. Your e-mail will never be published.