首页 > WordPress, 原创> 本文属原创文章,转载请注明来源并保留原文链接。

wordpress Related Posts相关文章插件

2007年4月23日 浏览 1 次 郑 永发表评论 阅读评论

请注意:(目前显示相关文章的功能已经有新的发现,只要利用tags就能实现更精确的相关文件显示功能,点击这里跳到新的方法文章)如果还是想用Related Posts插件,具体请到官方网站下载Related Posts 2.04 (相关文章插件)以后,此插件需要数据库支持全文索引fulltext search的功能,所以激活此功能后,在调用的时候会显示错误,需要在phpMySQLadmin里面运行SQL语句。

第一步:如果你的数据库不是mysql4.1,请跳到第2步,mysql4.1的数据表类型为InnoDB,此类型使mysql具有了外键、事务处理的能力,却不支持全文索引fulltext,可以运行SQL语句:ALTER TABLE `wp_posts` TYPE = MyISAM; 这样就可以支持了。

第二步:post_name、post_content字段建立全文索引:
SQL语句:
ALTER TABLE `wp_posts` ADD FULLTEXT `post_related` (
`post_name` ,
`post_content`
);
之后,wp就可以正常使用Related Posts(相关文章)这个插件了。

插件调用代码:

related_posts($limit, $len, ‘$before_title’, ‘$after_title’, ‘$before_post’, ‘$after_post’, $show_pass_post, $show_excerpt);

你可以根据你自己的需要,删除一些条件。其他设置请到官方站查询。Related Posts 2.04 (相关文章插件)

最后再次感谢来我博客花了时间给出评论的朋友!


标签:WordPress, 插件

相关日志

分类: WordPress, 原创
  1. 2007年8月18日18:26 | #1

    请问具体放在那个文件的什么地方?

    [回复]

  2. 2007年8月18日18:37 | #2

    如何建立全文索引的?
    相关文章
    WordPress database error: [Can't find FULLTEXT index matching the column list]
    SELECT ID, post_title, post_content,MATCH (post_name, post_content) AGAINST (‘beijing danshuanghao’) AS score From wp_posts Where MATCH (post_name, post_content) AGAINST (‘beijing danshuanghao’) AND post_date

    [回复]

  3. 2008年12月2日12:55 | #3

    我激活插件,后进入单篇文章,提示:WordPress database error: [Table 'dbname.wp_term_taxonomy' doesn't exist]……
    不晓得这个wp_term_taxonomy是个啥表呀?给看看?

    [回复]

  1. 本文目前尚无任何 trackbacks 和 pingbacks.