≡ Menu
SearchTechWord

WordPress Plugin: Related Posts with thumbnails by Category

I bet you must have tried different plugins to display related posts. But I am not sure why they have made it so complicated and come up with various algorithm. All I wanted was a simple, fast, efficient related post code that will display posts from same category with thumbnails. So I decided to write it myself and try to keep it as efficient as possible. Page load time is one of the factor in improving your PR after the Google Panda update. But at the same time, I wanted the related posts display to be pleasing to the visitors of my site. So here it is now I have shared with you all so that you can use the same for your wordpress site.

Major Features of KC Related Post By Category Plugin

  • The KC Related Post plugin can automatically display posts from same category below the contents of the post. Alternatively, it has option to disable the automatic display and you can place the related post code manually in the single.php at any place of your choice. (This should be used by only those who are familiar with coding).
  • It gives you two ways to display the related posts, either horizontal or vertical. If horizontal style is selected, you have the option to display the posts with thumbnail.
  • This plugin uses advanced algorithm to get the image related to the post. First it will check if any thumbnail image is used in the post (latest WP attribute of featured image for post). If it does not find one, then it will check for any attached images in the post. Lastly if no image is found then it will scan through the post contents and then pick up the first available image to display for the post. After these three scans if it does not find any image then it will display the default “No Image”.
  • Fast and efficient and SEO optimised.
  • Display related posts from same category. This saves time to scan the posts from all the categories which often slows down the page loading time.
  • Header text, number of posts, Max number of title chars can be configured through admin settings.

Here you can download the KC Related Posts By Category Plugin

Above all, I am here to help you with any issues you have. If you want to add more functionality or change the display of the Related Post, just drop an comment with your requirement and I will be more than happy to help you for FREE.

If you are using Thesis framework for wordpress then I have modified the above code to support Thesis. Read my earlier post to show Related Post for Thesis Theme without plugin.

Comments on this entry are closed.

  • PunK

    hey exactly what was searching :) but U misss one thing there is no option for message if no related entry found ! or If no Entry found we can also hide the Title “Related posts” from showing :) thanks

    • Yes that fix is on its way in the next release.. Thanks for the feedback. Any other requirement, then please let me know.
      Regards,
      Kunal

  • Gervase

    This is perfect.. Exactly what I was looking for. Thanks for sharing…

    • Thanks Gervase for dropping by.. Any suggestions to improve the plugins are always welcomed.

  • I just installed your plugin, Kunal . It works perfect. :)

    • Thanks Abhi.. I visited your website and its really good.. Nice articles you have posted. Keep up the good work.

  • Hi, thanks for this plug in, best related posts plugin i’ve tested. Small question,,, any way to change the order of the related links, seems to show the older ones first, and i’d like it to show the newer ones..

    • Hi John,

      Thanks for your feedback. Currently I am getting related posts from same category using random function. The reason I didnt select date to order the related posts is every time same set of related posts will be displayed for any post in same category.

      But if you want to display newer ones first, then I can change the code to display newest post first and email it to you.

      Now you have given some hint for improvement in my next update of this plugin. I will keep an option in settings to decide the order of related posts. Thanks for that.

      Also your site is too good..

  • PunK

    Hey Kunal ! what s update ?
    1 more thing need update Horizontal view is gr8 bt Vertical view show only list of posts
    I mean images not displayd in vertical view. I changed some settings to get this
    ScreenShot : http://img846.imageshack.us/img846/889/ss123o.jpg
    in this layout we can utilize the right side space for other stuff or Ads ;)

    • Hey Puneet,

      I have already updated the plugin to show “No Related Posts” text. This text is configurable and you can change it through settings. You can download the latest plugin for the changes.

      I have purposely not used images for vertical display as they are not used by most of the sites I have seen. But you can always tweak the CSS and change the display.

      The screenshot looks good. Yes you can save that extra space and display ads in that. I might consider adding that feature in future update if I get time :) Thanks for the feedback.

      You might also want to share the link to your site so that we can have a look… Good luck

  • PunK

    oh Updating nw :D Screenshot pic showing blocked domain error so again
    http://i56.tinypic.com/21jp07s.jpg

    tested the vertical layout on test site
    Link : http://www.dhuricity.com/test/artists/mintu-dhuri/

    • Hey Nice site Puneet.. Nice way to promote your own city. Liked the layout. What theme are you using? Make sure you work on page loading time as well as it is one of the factor in latest google panda update. Try installing WP super cache plugin.
      Overall it looks good.. Let me know if you need any help.

      • PunK

        thanks… plugin update notification not shown in admin I think u miss something may b ver. no. in plugin file!
        its own customized theme yea cache intentnaly off on test site U can check the main site i.e. wout /test where i use super cache i use it on my all WP Sites :)

        • No initially when i uploaded the plugin, i named the version as trunk instead of 1.0.0 So next time when I uploaded as 1.1, the notifications were not send.
          Customised theme.. have you done the customisation??

          • PunK

            ys I done it including custom homepage. m not professional & no training in field learn all with experiments :) 1 more suggestion 4 future versions
            u can also provide option to include 1 level parent category in results e.g. i use main category 4 yellow pages selecting this option we can also include posts from other categories within parent yellow pages 1st it scan child category if 4-5 post result found in child then show them & if no result or less result found then can also include some other posts from parent category in related result. Before ur plugin I used custom function but got current post also in related results lol :D Thanks again 4 the plugin :)

  • Love your plugin! But it has a HUGE sized font for “Related Posts.” http://bit.ly/kHHzQZ Could you take a look and let me know what on earth I have set incorrectly?

    Thanks,
    Paula

    • Hey Paula,

      Thanks for using my plugin. I am using normal h4 and strong tag to display Related Posts text. I guess your theme has some default setting for this tag.

      As an alternative, can you go on the settings for this plugin and instead of “Related posts: ” type “<h3>Related Posts: </h3>” This should undue the strong and h4 tag. Try that and see if that helps. Else I will try and fix the code for you.

      Please let me know if that works.

  • Great plugin! Thanks dude

    • Thanks for using the plugin. You have a wonderful site. Keep up the good work.

  • Hi there! Thanks for the plugin, it was so easy to set up. I have a problem though and was hoping you could check it out. For some reason when it is showing a related post for my one article it is writing the title twice instead of including the thumbnail and link.

    Here’s a page it’s doing it: http://militarywom.com/2011/06/dinosaur-deploys/

    It seems to only do it with the one article. I tried to shorten the title from 50 characters to 40, thinking that was the problem. But, that didn’t help. Is it because I have “…” in my title?

    Any help would be greatly appreciated thanks!
    Laura

    • Hi Laura, Thanks for using our plugin.
      It has nothing to do with the title. Its because the first image in that post is copied and pasted from assoc-amazon. Instead upload that image in Media library and then insert it in your post. That should resolve the issue.
      Please let me know if that helps..

  • Ah, that makes sense. Thanks, I fixed it and it is now fixed. Another, thing I just noticed is that I will get “No Related” posts when a page has more than one Category, with only the first Category having no other posts.

    For instance on this page: http://militarywom.com/2011/06/snow-boots-to-flip-flops/
    the Categories are Hawaii and Moving. I have no other posts under Hawaii yet, but I have others in Moving.

    Is there away for the plugin to look at all Categories?

    Thanks again for your help!

    • Hey Laura,

      In order to search for posts in all the categories to which it belongs, I need to change the code a little bit. I have done minor changes to code and have emailed you the new file. All you need to do is replace the existing file with the new one. That should take care of your requirement.

      Also I will try to include this in the next version I release.

      • Works like a charm! Thank you so much!

  • Nice plugin. Thinking about using it on my site.

    Have you thought about making it show the related posts in a a circular carousel type display. I’m thinking about something similar to what I have on my site. See the top part of this page for example: http://www.linuxbsdos.com/2011/06/25/fedora-15-kde-review/

    Showing an unlimited number of posts from the same category in that fashion will make this plugin even better. Thanks.

    • Showing a slide show will require javascript to be used. The whole purpose of this plugin was to create a fast efficient display. Wanted to keep the page loading time as optimum as possible.
      Hence scanning posts from same category so that entire database is not scanned. Also using simple CSS to display thumbnail. Frequent use of javascript is not recommended and it does affect the performance of your site and hence the ranking.

  • In addition to a template tag and auto-insertion, it would also be nice if the plugin could have a shortcode for inserting in a post or page.

    • Plugin already has a manual code to put in any template your want. See the plugin settings menu.

  • I just installed it on http://linuxbsdos.com. so far, it looks good.

    Another suggestion: Tooltips, so that on mouseover, the complete title of a post will show in a tooltip, if the title is not fully displayed.

    And a small issue: I left the Header Text blank, and it leaves too much of a gap atop the list of posts. I could probably change this in the CSS file, but you might want to think about it in the next version

    • Thanks for the feedback. I will consider adding this in the next version.

  • Finally, I do not know why, but sometimes, the posts displayed are not even from the same category See for example, this page: http://www.linuxbsdos.com/2009/08/03/pardus/

    • That might be because your post is included in multiple categories. If that is the case then it will show posts from first found category to which that post belongs.

  • going to try this in my blog right now!

  • Jim

    Hey There!

    Love the plugin, but have a small question. My client’s theme stores photos for a given post in a custom field. Is there an easy way to adjust the code to be able to look there for the photo?

    Thanks,

    • Hey Jim,

      Thanks for trying out my plugin. The answer is YES. I will do the code change for you and add an extra field in the settings wherein you can specify the custom field name which stores the image.
      I had done something similar for one of my site. It will be a good idea to include the option to specify custom field.
      If not today, by tomo I will defintiely send you the new code. Hope that helps.

      Regards,
      Kunal

  • Hi KC!
    Can you help me on something? When I click horizontal, it looks fine except it says “No Image” above the titles, so I switched to vertical until I can figure out what’s wrong.

    I inserted all my images into my posts at full size. Do I need to go back through all my posts to shrink them to thumbnail? I would rather not do this as it looks better to have the full photo in the post. Is there a way it could pull the thumbnail images from the home page?

    You also said something about “latest WP attribute of featured image for post”. I have the latest version of wordpress but maybe I’m wondering if I need to take some sort of action with this as well. I’ve been playing with plug-ins for this all morning and yours was the easiest to load. Let me know what I need to do to get the images up. Thank you! :-)

    • Hi Anna,
      Thanks for using the plugin. I did visit your site and the “no Image” is displayed when it is not able to find any valid image. Is your theme using Custom Field to store the images? Or you manually insert the image when writing the post?
      No need to insert thumbnails in the post, resizing is done by the plugin code. So you dont have to worry about the size of photos.
      Regarding the “featured Image”, it should be supported by your theme. If you see the default “Twenty Ten” theme, every post editor has a “Featured Image” option on right hand side bar (below the place where you enter tags for the post).
      Let me know if you using custom field to specify images for post. Then I will respond accordingly.

      Regards,
      Kunal