Open Source Everything


WordPress Plugin – list posts in category

I needed a wordpress plugin to list the posts in a specific category in another post or page. Specifically, I'm building a job posting static page, and it wanted it to list all of the "blog posts" tagged "posting".

Chris McCafferty came through with his posts-in-category plugin, but it had a small bug where it would kick out an error if the category was empty (which might happen for us when there are no active job postings).

I added a quick check to the variable in question to make sure it wasn't empty before it was used, and voila, the perfect plugin for what I need.

I'm sure Chris will update the official plugin soon, but until then, here's a quick link to the updated version. Just save it in your plugin dir and rename it to posts_in_category.php

Comments (6) Trackbacks (0)
  1. Thank you, I’ve fixed the code. I appreciate your input.

  2. Hi, it seems that Chris’ sites are down and I can’t find a backup of the plugin online. Can you please mail me your version?
    thanks! Martijn

  3. Just a quick tip to anyone else using this plugin. If you want to insert this command into a template, instead of a page or post, use:

    … replacing #19 with the ID of the category you want to list.

  4. Posted php code in the comment above but it didn’t display. If you need the code, feel free to contact me through ~ James

  5. What I want to do on my blog, is every few hours take the oldest post and move it to the
    front of the queue, all automatically. Anyone know if there is a plugin that can do this or
    a simple way to set up another plugin to do this (use my own feed perhaps)?

  6. Just wanted to say thanks for still having the code up for this. I have been trying to find this plugin for a long time but couldn’t and I finally stumbled on your modification. Thanks again!

Leave a comment

No trackbacks yet.