Welcome to Dagon Design. In addition to free scripts, WordPress plugins, and articles, we offer a variety of services including custom theme design, plugin creation, and PHP scripting. Contact me for more information.

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. Ahh, sorry, I feel so silly, I just realised there was more than one page of comments, and found the answer on one of those. Thank you anyway, I will be sure to mention this excellent plugin to my friends!

  2. Hi, does anyone know if it’s possible to use this plugin outside of having it in a post? I need a way of doing this, but putting it in a sidebar in a specific single.php to call the titles of the other posts in the category. Any advice would be great! Thanks.

  3. He, I knew it wasn’t going to work but I just had to try… Ok, if there’s someone interested, I’ll come back again and do my best to post the code.

  4. Thanks for this!

    Just in case someone is interested, I’ve changed some code to show a “(View all)” link at the bottom of the list:

    line 341 $the_output .= '<a href="' . get_category_link($curr_cat_id) . '" rel="nofollow">(View all)</a>';

    line 348 $the_output .= '<a>cat_ID) . '"&gt;(View all)</a>';

    You can vew it at http://cachuflos.net/ciro/ (in Spanish and always under construction).

  5. you rulez man.
    helped me to put the list on a new sidebar.

  6. yeah, I already understood that :) but didn’t knew about the “loop”.. oki will try to modify it on my own.. :P

  7. Dimitridze: The reason it will not work is because the plugin has to execute within the main wordpress ‘loop’, otherwise it will not know what category you are currently viewing. There are options, but it really just depends on how your template is written. A modification of this script (if it would still work depending on the situation) would be neccesary. :)

  8. What if I want the list to be outputed outside Post’s ? I’ve tried call the “ddop_show_posts();” function outside manualy, but it didn’t work..

    your other function “ddop_generate” is processing $content variable, so it’s no use for me..

    can u help? or mb i ought to find another plugin.. :/ i dont want the list to apear within posts, but after it..

  9. [...] 這個 Other Posts From Cat 還蠻常見的,就是在文章後附上和這文章相同類別的最近 n 筆文章 ~ [...]

  10. Fantastic plugin - thanks!

  11. [...]   日志现在用上了Other Posts From Cat这一个插件,它可以在每篇日志底部列出跟该日志分于同类的其它日志。使用起来非常方便,在后台激活就行,所有更改都在后台完成,不用改代码文件。而且,也可作为相关日志插件Related posts的代替。推荐使用! [...]

  12. 34
    Sparanoid

    Great plugin, and can it shows only the older posts in the same cat. than the current post?

  13. Andy: Check out the new version (1.2) I just uploaded ;)

  14. Admin: It’s sort of what is expected. If more than one category, it says, for instance, Last posts in X Cat, Y Cat, Z Cat, and lists them al together.

    Thanks for the modification

    What I meant is is it possible to have it work like this when more than one category:

    “Last ? Posts in X Category:”
    -post
    -post
    -post
    -post
    -post

    “Last ? Posts in Y Category:”
    -post
    -post
    -post
    -post
    -post

    and so on.

    Thanks again though! :D

  15. Andy: Check out the new version :) It includes an option to show recent posts from all categories the current post is in. I have tested it, but not that much, so let me know if it works for you :) (the option is disabled by default, be sure to enable it).

    MoiMM: I have added a CSS class around the output. More information is in the article above :)

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.