开发者

PHP wordpress style related posts

Do you know how开发者_开发问答 wordpress decides which related posts to show?I mean I know if it has tags, then it's easy but if it doesn't?

Best Regards,


Generally the 'related post' function of a Wordpress Blog is created by the owner of the blog, or using a plugin. I can imagine that those plugins either look for new posts with similar tags or in the same category as the post it is displaying.

As far as my knowledge extends, I do not believe that Wordpress has a show_related_posts function, although I may be wrong. If it does, it would be simple enough to look it up on the documentation at wordpress.org.

Also, another good part about OpenSource programming is that you can simply go in and look at any of the code that you are curious about. I personally use Notepad++, and when I find a function in Wordpress or any other CMS I am not famillar with, I simply copy and paste the function name, and do a Multi-File search on the function to figure out where it is declared.


I'm going to have to go with Chacha102, as far as I know this can only be done using plugins or by hacking the code yourself.

I did something similar by falling back on the post's category if it had no tags, works pretty well too.


This guy has the leading plugin for related posts. I'd download that and take a peek at his code and see how he does it. Then you can reverse engineer it and make it your own. The beauty of opensource.

http://wordpress.org/extend/plugins/wordpress-23-related-posts-plugin/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜