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

  1. Larry’s avatar

    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?

  2. ceejayoz’s avatar

    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.

  3. Larry’s avatar

    Ah, ok…. thanks for the info.

  4. Larry’s avatar

    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…

  5. ceejayoz’s avatar

    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.

  6. Larry’s avatar

    Ok… thanks again. Sorry for the bother.

  7. Larry’s avatar

    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 :)

  8. ceejayoz’s avatar

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

  9. ceejayoz’s avatar

    Larry,

    I’ve released a new version implementing your fix.

    Thanks!

Comments are now closed.