Version 1.9

Lots of goodies in this release, based on the feedback and requests I got from you guys (and gals).

The Menu Format

First off, there’s a new format called “menu”. It’s basically the year and month menu from the fancy format, but without the post list. It’s meant to be displayed on year and month based archives, to aid navigation.

Usually, those archives are handled by the archive.php template in your theme, so that’s where you should use it:

<?php smart_archives('format=menu'); ?>

New arguments

There are also two new arguments:

month_format – can be one of ‘numeric’, ’short’ and ‘long’

posts_per_month – set the number of posts displayed per month; by default, all posts are displayed.

<?php smart_archives('posts_per_month=25'); ?>

Finally, you can now customize the look and feel more easily. See Advanced Tweaking.

Advanced Tweaking

Since version 1.9, you can make modifications to the plugin output, without having to modify the plugin code. This way, your tweaks won’t be lost when you upgrade the plugin.

Custom styling

If you want to customize the appearance of the archives using your own CSS, here’s how you do it:

  1. Add this code to your theme’s functions.php file:
  2. add_filter('smart_archives_load_default_styles', create_function('', 'return false;'));
  3. Copy everything from smart-archives-reloaded/inc/styles.dev.css into your theme’s style.css file.
  4. Change the CSS in your theme’s style.css file, as needed.

Custom markup

If you want to go one step further and change the generated HTML markup, you can do that too (understanding of object inheritance is required).

First, take a look at the SAR_Generator class (in smart-archives-reloaded/generator.php).

In your theme’s functions.php file, you can extend that class, like so:

smart_archives_load_default_generator();
 
class SAR_Custom_Generator extends SAR_Generator {
	protected static function generate_fancy() {
		// your custom code here
	}
 
	protected static function generate_block() {
		// more of your custom code here
	}
 
	...
}

Then, all you have to do is add the ‘generator’ argument to the template tag:

<?php smart_archives('generator=SAR_Custom_Generator'); ?>

Version 1.8

Previous versions of this plugin allowed only a single type of archive, controlled entirely from the settings page.

Version 1.8 is a lot more developer friendly: any options set on the settings page can be overwritten:

In your theme, you can now write:

<?php smart_archives('format=list&exclude_cat=123,543'); ?>

This works for the shortcode too. In any post or page, just write:

[smart_archives format=list exclude_cat=123,543]

What’s neat about this is that you can have more than one archive, or have the archive display differently in different parts of your site.

Version 1.7

This release was basically written by Simon Pritchard. I just added the finishing touches.

Fancy new style

Version 1.7 adds an integrated multi-level navigation UI to the archives, perfect for sites with a large number of posts.

Fancy archive on the default theme

See a live example.

New formatting tags

First, you have %category_link% and %category%, which will output a category list for each post.

Secondly, you have %date%, wich will print out the publish date of each post. There is an additional field where you can customize the date format.

If you like the new features, go thank Simon for his effort.

Version 1.5

This version adds a new setting, namely the ability to display the month links in the block as numbers from 01 to 12.

The plugin is now fully translatable.

Finally, the cache file is now located in the uploads directory, so that you don’t have to mess with file permissions anymore.

Version 1.4

Instead of updating the cache at a regular interval, the plugin now updates when a post is published or deleted.

Also, an issue with accents should be fixed.

Finally, some optimizations were also baked in.

PHP5 is required

Version 1.3

This version adds a new feature and has several bugfixes and improvements:

  • new: month links in the block can point to month titles in the list.
  • new: validate excluded categories input
  • fix: block respects excluded categories option
  • new: uses scbOptionsPage framework 1.0
  • fix: single wp-cron event when changing cache interval
  • fix: redundant calls to displaySAR::generate()

PHP5 is required.

Version 1.2

I have been using Smart Archives for some time and I really liked it, but version 2.0 wasn’t up to snuff, in my opinion. So I decided to improve it, until I ended up with this plugin:

  • Easy setup – no code editing required
  • Better caching – no need to wait when publishing a new post
  • Settings page – elegantly choose how you want the archives displayed

Version history

  • 1.2: better HTML output; various optimizations and bugfixes
  • 1.1: switched to wp_cron for updating the cache
  • 1.0: initial release