Version 1.6   Updated Sunday, April 27th, 2008 at 8:20pm

Other Posts from Cat plugin for WordPress

This plugin will show the last X posts from the current category at the bottom of every post, or where you manually specify in each post. Using the built-in options page, you can choose the number of posts to show, set the header text, choose to show the post dates, select the format of the date, and choose whether or not to include the current post in the list. The latest version also has an option to show recent posts from all categories the current post is in.

Download

  • Latest Release (For WordPress 2.0 through 2.5)
  • International Version (For WordPress 2.0 through 2.2)

    One of our visitors sent in an internationalized version of this plugin, with full support for international text and date formatting! It includes English and Spanish support. This version is only supported by WordPress 2.0 through 2.2, and will not work in 2.3 or 2.5

Instructions

  • Download the above file, rename it from .txt to .php, and upload it to your plugins directory.
  • Enable the plugin.
  • Configure the plugin options (under DDOtherPostsFromCat).
  • Test it out by viewing a post.

Change Log

  • 04-27-08 Version 1.6 Added an option for excluded categories. Also a few other minor fixes.
  • 09-29-07 Version 1.5 Updated for WordPress 2.3. Added ‘Load Default Options’ button.
  • 06-11-07 Version 1.41 Added wrapper class around output (.ddop)
  • 05-16-07 Version 1.4 Updated for WordPress 2.2.
  • 01-28-07 Version 1.3 Fixed an issue in which a database error would occur when the plugin is set to check all categories that the post is in, and it is in only one.
  • 08-09-06 Version 1.2 Now if showing posts from all categories the current post is in, you can also choose to split them up into multiple lists (per category).
  • 08-08-06 Version 1.1 By request, the plugin now features an option to show recent posts from all categories the current post is in. It also has a CSS class added for easy changes.
  • 04-19-06 Version 1.0 First release. This is very similar to my ‘Posts by Author’ plugin but it lists other posts from the same category, instead of other posts by the current author.

Notice

Currently this plugin checks the first category a post is assigned to when generating a list of other posts in the same category. This means that it will work best for those of you who only assign one category to posts.

Styling

This plugin now has a div wrapped around the output with the ddop class assigned to it. For example, if you wanted to decrease the size of the text in the output, add this to your CSS file:

.ddop { font-size: 90%; }

Options

Here are the options available in this plugin’s options page in the WordPress admin panel.

Show at the bottom of every post

If enabled, this plugin will generate its data at the bottom of every post, before the comments section.

NOTICE: No matter what you have this set to, you can also manually call this plugin by entering the following line where you want the data to be shown in your post:

<!-- ddpostsfromcat -->

Check all categories that current post is in

With this option enabled, recent posts from all the categories (that the current post is in) will be shown. It will also show all of these categories in the heading (if you are showing one). Disabled, it will simply show other posts in the first category this post is found in.

Split categories into separate lists

This option only applies if the previous option (check all categories that current post is in) is set. It will allow you to split up the posts into multiple lists (per category) instead of all the posts being in a single list.

Number of posts to show from this category

This is the number of posts from the current category that will be shown.

Text to show before list

This is the header for the post list. If you want to use the category title in this text, use %C.

Show date after listed posts

This will show the post date after each post in the list.

Date format

If you are showing the date after posts, this will allow you to configure the date format (using the standard PHP date() format)

Include current post in list

This sets whether or not the post being viewed should show up in the list of other posts from this category.

Show newest posts first

If checked, this will show the newest posts first in the list. If not checked, it will show the oldest posts first.

Excluded Categories

This is a comma-separated list of category names you want excluded from this plugin. It is not case sensitive.

Pages: [10] 9 8 7 6 5 4 3 2 1 » Show All

  1. Version 1.6 Released

    This version has been verified to work with WordPress 2.5.

    An ‘Excluded Categories’ option has been added, as well as a few other minor fixes.

  2. 145
    drtopo

    Thanks for your great work.

    I have the same intention than Adil (#91): to exclude some categories (or to include just a few). I tried the solution proposed in #92, but nothing happens (it shows all the categories of the post).

    Any ideas? Thanks in advance.

  3. Is there any way to include a list of posts from a static page. This of course would mean the ability to also define which category to list…is this attainable using this plugin. I have been searching for a plugin to do this for a while, as I use static pages as part of a CMS solution with my websites.

  4. Hi, I found a problem and fix it.
    I had a post with “&” in it.
    So I’ve added htmlspecialchars to the output, like this htmlspecialchars($lpost->post_title), now the code is valid. :)

    Great plugin. Thanks !

  5. Hello,

    thank you for this great plugin! But I have problem it shows me:
    WordPress database error: [Table 'U7973116.wp_post2cat' doesn't exist]
    SELECT DISTINCT ID, post_title, post_date, post_category FROM wp_posts, wp_post2cat WHERE category_id = 48 AND wp_posts.ID = wp_post2cat.post_id AND ID != 14 AND post_status = ‘publish’ ORDER BY post_date DESC LIMIT 5

    You can check it at link above (my signature) at the end of the page.

    I am looking for reply.

    Thank you!!

  6. 141
    EssenzZo

    I uesd this plugin. Its working. But I need the php code to insert in my template. Please help me out.

  7. Hi

    It is a wonderful plugin. However, when I include more than one category, the posts seem to repeat. Is there a way to remove this duplication?

    Thanks
    Anand

  8. Just edit your plugin and take the text from the latest version and copy paste.

  9. 138
    LPX

    Hey man,

    Great plugin, but I get the following errors:

    WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND wp_posts.ID = wp_term_relationships.object_id AND wp_term_relationships.' at line 7]
    SELECT DISTINCT ID, post_title, post_date, wp_terms.term_id as post_category FROM wp_posts, wp_terms, wp_term_relationships, wp_term_taxonomy WHERE wp_terms.term_id = AND wp_posts.ID = wp_term_relationships.object_id AND wp_term_relationships.term_taxonomy_id = wp_term_taxonomy.term_taxonomy_id AND wp_term_taxonomy.term_id = wp_terms.term_id AND ID != 500 AND post_status = ‘publish’ ORDER BY post_date DESC LIMIT 400

    Any idea what’s up?

  10. hey,
    thanks for the plugin. it’s great. honestly :)
    i’d like to know, though, how can i go about adding excerpts next to the listed titles. (i’ve seen two other users interested in doing the same thing. i would appreciate it if you could email me the solution as well or post it here. or even better, maybe adding it in a future version?)
    i would also be interested in knowing if there’s a way of listing related posts randomly.
    cheers!

  11. I searched the nine pages of comments, and didnt see a request, so I thought I would ask. Is there any way to include a list of posts from a static page. This of course would mean the ability to also define which category to list…is this attainable using this plugin. I have been searching for a plugin to do this for a while, as I use static pages as part of a CMS solution with my websites.

Pages: [10] 9 8 7 6 5 4 3 2 1 » Show All

Leave a Comment

Before you comment: If you are having an issue with a script, please make sure you have read the entire article. Also, please read through the comments because most common issues have already been discussed many times. Thanks.


Be sure to wrap all code in <code></code> tags.