views:

77

answers:

3

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,

+1  A: 

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.

Chacha102
I want to build something like that by myself!
Uffo
Then I would suggest finding a 'related post' plugin, installing it, and looking at the source code for ideas. Frankly, it is just a wordpress query that shows all the titles in a list.
Chacha102
A: 

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.

Alex
A: 

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/

Code Monkey