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.1   Updated Sunday, February 22nd, 2009 at 2:14pm

Recent Categories Plugin for WordPress

This plugin generates a simple list of the most recently created categories in your WordPress installation. You can specify the number of categories listed, and the titles link to the category archives. This plugin can be called from a post or page, or directly from a template file. You can also choose to show the date the category was created.

Download

  If you have found this page useful, please consider donating. Thanks!

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 DDRecentCats).

Change Log

  • 02-22-09 Version 1.1 – Added options page. Can now choose to display date of category creation, and format the date display.
  • 08-28-08 Version 1.0 – First release.

Usage

There are two ways you can use this plugin. With both methods, ‘X’ is the number of categories you would like to display. They will be sorted with the most recent first.

1) In a post or page, insert the following line:

<!-- recentcats X -->

2) In a template file, insert the following code:

<?php echo dd_recent_cats(X); ?>

Important: If you use the first method, make sure you add this using the html/code editor in WordPress, not the visual editor. In new versions of WordPress, just click the ‘html’ button above the edit box. If you use the visual editor it will not work, as the actual code you entered will be seen on the page, instead of being processed by the script.

Options

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

Show Date

If enabled, the creation date will be shown next to each category. Since WordPress does not store the actual date a category is created, the value used is the date of the earliest published post in that category.

Date Format

If showing the date, it can be customized using this option, which follows the standard PHP date format structure.

Customization

This plugin generates a standard html list. If you would like text above or below the list, you can add it to your post or page, or directly into the template file you call the function from.

Additionally, the CSS class ddrc is given to the <UL>

<ul class="ddrc">
<li>..cat link..</li>
<li>..cat link..</li>
<li>..cat link..</li>
</ul>

You can use this to customize the list display in your theme’s CSS file.

  1. 15
    asif

    not working for me in wordpress 2.9.2

    please help

  2. ul class=”ddrc”

  3. Uhmm I Get A blank when i Check the Source of the page i only see

    then a blank any solutions for this…
    Please and Thanks

  4. Great plugin! I can’t believe this isn’t already included in WordPress. One question, wondering if I can exclude a category (like “Uncategorized”). I’m looking at the plugin’s .php and scratching my head…

  5. Say you create a new dress that you want to offer at your store. ,

  6. Wow, Thanks for shared.

  7. 8
    Trish

    I want to put the date on the left instead of the right. How can I do this?

  8. Are there any known issues with Thesis 1.5.1 and wordpress 2.8.4? I have added the trigger script to my pages but there is no output on the page.

    This script worked for me in earlier versions?

  9. This plugin has been tested, and works, in the latest release of WordPress – 2.8

    Andre: If you would like more control over where the output is generated, instead of using the trigger text, use the method above to insert the code directly into your template files.

  10. 5
    André

    I wannna know if there’s a way to edit its position on my post page. The problem is that Ia have other plugins to work on post footer (like “post by same author”, “rating posts” and “related post”) and I couldn’t figure out how to organize their order. If I could just put the recent categories plugin above all rest would be fine for me.

  11. Version 1.1 Released

    An options page has been added for this plugin, which allows you to choose to display the date of creation next to the category. You can also customize the date format.

    * Note – since WordPress does not store the actual creation date of categories, the value used is the date of the earliest published post within that category.

    This plugin has been tested in the latest release of WordPress (2.7.1)

  12. This plugin is exactly what I was looking for. Hope the next version have a date next to it.

    Thanks for the plugin.

  13. Hi,
    Thank you for the plug-in. It is exactly what I need. I use Gengo plug-in for multilingual support and I separated my categories according to the chosen language. This plug-in shows categories of all languages in the page which is not a bug, but I would like to suggest you to make some kind of option to choose which category to be shown in the page or post.Best Regards

  14. 1
    Ruriko

    I want to put a date next to the title. Is this possible?

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.