认真对待,不要偷懒

这个插件,Dagon Design Sitemap Generator,生成站点地图用的。升级 WP 2.3 后突然不好使了。

郁闷了两天决定看一下错误代码,原来是

WordPress database error: [Unknown column ‘wp_term_taxonomy.taxonomy’ in ‘where clause’]
SELECT ID, soft_term_taxonomy.term_id as category_id, post_title , comment_count FROM soft_posts, soft_term_relationships, soft_term_taxonomy WHERE soft_posts.ID = soft_term_relationships.object_id AND soft_term_relationships.term_taxonomy_id = soft_term_taxonomy.term_taxonomy_id AND wp_term_taxonomy.taxonomy = ‘category’ AND post_status = ‘publish’ AND post_type = ‘post’ AND post_password = ” AND post_status != ‘future’ ORDER BY category_id, post_title

看到 wp_term_taxonomy.taxonomy 我想到了估计是数据库头的问题,小众的数据库头一直用的是 soft_ ,这里出现 wp 肯定是插件 bug,搜索插件第 950 行 AND wp_term_taxonomy.taxonomy = ‘category’ 改成 AND soft_term_taxonomy.taxonomy = ‘category’ 即可。

发表评论

This site uses Akismet to reduce spam. Learn how your comment data is processed.