The Code

WordPress has been supporting tags in its new released – so the related posts feature can be implemented without the help of any plugins. All we have to do is find the other posts with some same tags as the current post. Just open the single.php file in your theme and add this bit of code where you want the related posts to show up…

WordPress Plugin Killer Series

For those who came in late, this post is part of the WordPress Plugin Killer Series. This series will show you how to duplicate the functionality of the a few wordpress plugins without having to install it using custom code in the wordpress theme. The previous posts in this series are…

45 Comments

After following this tutorial, I couldn’t get a couple of things to work. The permalinks will not work with the register_post_type() and arrays outlined in a function; I simply removed this and permalinks worked fine

I found small bug .
After i used this code on my website, comments was all messed up. When i write comment it take me to another post and comment is written randomly for some other post. If anyone else experience this i try this method
ID);
if ($tags) {
$tag_ids = array();
foreach($tags as $individual_tag) $tag_ids[] = $individual_tag->term_id;

i’m using using best related post plugin…it more easier no need custom field as thumbnail.
Just upload,active it..viola..its automatically add thumbnail and also you can match it with your theme setting. You can download it from http://ifile.it/wl26j8x

Is there a way to assign a current-item class to the li element containing the link of the current post? I know that your code does not shows the current post title in the list but it is very easy to change it to do so.