Related Posts Plugin

Here’s a related posts plugin I cooked up that will display a list of (possibly) related posts at the bottom of posts. Requires Ultimate Tag Warrior.

Tags: , ,

9 comments

Nice, but I have an ‘issue’ with it… Seems that it doesn’t want to use my current permalink structure (I’ve changed it a few times in the past) and I’m unsure how to make it use the correct links. Any clue as to how I can do this?

You’ll probably need to ask the Ultimate Tag Warrior author on that one. This plugin doesn’t generate the links, it’s just a wrapper for the UTW function that does.

Ah, ok…. thanks for the info.

Actually, did I make it clear that it’s not referencing to the correct permalink to the entries? I don’t mean the tags… I mean when I click on a possible related post, it sends me to the entry’s original link structure…

The related posts list is generated by the UTW plugin, so any irregularities in permalink structure in those generated links are out of my control.

Ok… thanks again. Sorry for the bother.

Ok ok… I promise this will be my last post… I did some spelunking around the UTW code, and found what could be the solution.

Your plugin uses “$post->guid” to get the link to the entry… UTW, however, uses this… “get_permalink($post->ID)”.

Replacing the original piece of code with “get_permalink($post->ID)” seems to fix everything.

I’m no PHP wiz, but I hope this will help you out with the related posts plugin :)

Sounds good, thanks. Strange that the GUID wouldn’t match the permalink!

Larry,

I’ve released a new version implementing your fix.

Thanks!