July 26, 2009

Wordpress Charted Archives Plugin

His thought process -as he wrote in ‘Now With Navigation and Charted Archives‘- was that someone new to the site could see the graph and very easily get a feel for the frequency of his posting and I liked it a lot. I have seen similar features before, but not linked to the archives nor executed as beautifully as his. This is why I decided to make it a plugin.

I’ve got it live in my sidebar now, but as it may not be there for ever, this is how it looks.
Charted Archives
If you like it just download the plugin. Install the plugin and you can use it in three ways:

  1. As a widget: go to Themes > Widgets to add the widget to your sidebar. Add the number of months to display in the widget properties, it defaults to zeven.
  2. As a php tag in a template: <?php Charted_Archives($number_of_months_to_show) ?>
  3. Or use a shortcode in a page. [chartedarchive months=”12″] (where 12 can be any number of months).
Update: there was an error in the CSS link which is now corrected. The download link above reflects the new version.

Update 2: I added a shortcode for easier use in pages.

February 21, 2007

Is home or is frontpage?

Version 2.1 of Wordpress introduced native support for a static frontpage, which only has been supported by plugins before. When using this option however, the is_home function doesn’t work. This is because is_home is supposed to return true for the “blog” home page, where your most recent posts show up, not the “front” home page. An is_frontpage function is not available yet.

Therefore I whipped together this small plugin, called is_frontpage. Just download the plugin drop the file in your plugin folder, activate the plugin through the admin interface and the is_frontpage function is available to you. Use it just like the is_home function. It returns true if you’re at the frontpage you set, otherwise it returns false.

Syntax

To be complete here the syntax: is_frontpage()

if (is_frontpage()) {
do something
}