is_frontpage: plugin for static homepages in WordPress 2.1.x

If you remember, WordPress 2.1 have introduced a built-in support for static frontpages. It caused some confusion initially, cause plugins which used to provide this functionality, stopped working completely. However, one you discover the feature, it’s very easy to use it.

There is one small problem though: is_home() function will not work for such static frontpages. To work around, you can use a plugin called is_frontpage. Here’s how its author, Martijn Stegink, describes it:

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.

Taken from: Bos89.nl blog

Speak Your Mind

*