Kahi’s Clean Archives, a plugin

Published: On Monday, March 24, 2008

Plugin, that allows to create a chronological list of posts, an archive, clean archive. The behaviour is particularly suggestible via administration. Generated archives are cached, so the performance of the plugin is optimized.

Result usually looks like this:

History & Inspiration

I like this kind of archives, I started use it on my pages long time ago. First I have used the SRG Clean Archives plugin by Shawn Grimes(Sporadic­Nonsense), then I updated to the sequel of the same name, but developed by Sean R. (GeekWithLaptop) (actual plugin's page). Thanks to them. Because of that, My Clean Archives exists.

And why I've decided to reinvent the wheel? The old 2.x version of SRG Archives does not cache its work's results. The archives is generated again and again every time it's loaded and one load runs hundreds of queries and can take seconds. Sean's newer version uses a cache, but I don't like the way. Because of that, My Clean Archives save cache into a file.

The code of SRG CA 4.x is imho very chaotic, practically unreadable, and any changes in the HTML output are difficult to make. Because of that, My Clean Archives allow to modify HTML output via admin's interface.

And one more thing: Sean's CA adds at the end of archives a link to him, or to the plugin's page, no matter. And this is something what I personally don't like.

Settings screen shot

Usage & documentation

You will include archives into a Page:

  1. by adding <! --kahis-clean-archives--> into the content (without the space after !)
  2. by adding this code into the a template file: <?php if (class_exists('KCA')) echo KCA::GetArchives(); ?>

Variables able to use are always fully documented on the plugin's settin­gs page.

You may notice that Kahi's Clean Archives do not provide some „variables“, that SRG provides. For example count of comments beside each post. I myself don't need such an information and that is the reason why I didn't include some another options. Also I could forget, of course. You can make me know what you would like and I will decide if to implement that. Actually, thanks for any feedback.


  • PHP 5 on your webserver (plugin is not compatible with PHP 4!)
  • tested on WordPress 2.3, 2.5, likely works from 2.0.


License: Kahi's Donati­onware

Download Clean Archives plugin (RAR archive, 15 KB)

Archive contains all existing localizations:


  1. 1.  Sascha wrote: On April 19., 2008 comment number 1

    Thanks a lot. Just yesterday I updated my Blog from version 2.0.11 to 2.5 and one of my main problems was the one with the archives, your plugin is the solution. Actually I don't like Sean R.'s plugin too.

    But one question: I would like to add exact date and number of comments (yes I know, you wrote about that in this blog entry) just like on that page: http://www.di­ebistumsliga.de/ (go there to ARCHIV). Is that possible?

  2. 2.  Kahi [author] wrote: On April 19., 2008 comment number 2

    ↪ Sascha Thaks for that comment ;). I realized that your wishes are actually quite simple to add and they will be included into next version. Until then you may use this code http://kahi.cz/tem­p/files/kca-1.1-apha.rar (just replace the main file). It allows whole dates (day-month-year) and comments-counts in the post-template.

    %day_num%.%month_num%. %year% - <a href="%post_url%">%post_name%</a> (%comments_count%)

    But, this alpha doesn't keep comments-counts up-to-date. Final version will handle it.

  3. 3.  Sascha wrote: On April 19., 2008 comment number 3

    Wow, that's a nice service, thank you again :) Works perfectly and that's just how i want my blog archive, woooho.

  4. 4.  gazrang wrote: On April 25., 2008 comment number 4

    Hi. I found this plugin while searching for some useful archive plugin for my blog. I installed and followed instruction above for my template.

    But I have error message and i got blank page. It says like these :

    Warning: Invalid argument supplied for foreach() in /home3/gazrang/www/wp-content/plugins/kahis-clean-archives/kca.php on line 235
    Warning: Invalid argument supplied for foreach() in /home3/gazrang/www/wp-content/plugins/kahis-clean-archives/kca.php on line 235
    Warning: Cannot modify header information - headers already sent by (output started at /home3/gazrang/www/wp-content/plugins/kahis-clean-archives/kca.php:235) in /home3/gazrang/www/wp-includes/pluggable.php on line 689

    What should I do for it working? I use WP 2.5 latest version.

  5. 5.  Kahi [author] wrote: On April 25., 2008 comment number 5

    ↪ gazrang Thanks for report. Now I don't know what could cause this. Are you sure you have at least one post published on your blog/site?

  6. 6.  gazrang wrote: On April 26., 2008 comment number 6

    Kahi // Thank you for your reply. I managed my blog about a year, and it of course has more than one post :) But all posts were written in Korean, many foreigners cannot understand what I've written.

    That error doesn't appear in my local wordpress(installed via xampp lite). If only it is moved on web, that error does show up.

I quit working with WordPress, comments are closed. My plugins will not be updated any more – at least not by me. Feel free to modify my source codes though… Also I am not able to provide support, sorry. –Kahi