The Nexus
Show navigation Hide navigation
  • BLOG
  • ABOUT
    • Ego Surfing
  • PROJECTS
    • n2
    • S2ajax
    • Condo
    • ezEdit
    • FreeBlog - Air
    • Tooredo Alpha
    • Tools
    • Journlr, Again!
6 Jun 2010 | 2 min. (296 words)

Wordpress Plugin: Page-Theme...themes your pages!


I was quite surprised, when looking for a way to assign different themes to some pages, to not manage to find an easy way to do that. It is not baked into WordPress, and I could not find a suitable plugin either.
I had, a while ago, created a tiny plugin that did just that for me but it was way too simple and unfriendly to configure. I eventually stumbled upon the ‘domain theme’ plugin which, even though it does not do what I need, at least showed me that there is a way to perform a proper theme switch cleanly.
Note: if you’ve been reading this intro, thinking: “But there is a way to switch templates!”, then you’re right because there is; however I am not talking about templates but themes. Templates are pre-recorded page structures whereas themes are about changing your blog’s complete look and feel, including logo, stylesheet, etc.

Hence, page-theme : a simple plugin with a friendly user interface that lets you specify a given theme for any of your pages. Here is what it looks like:

Two limitations you need to be aware of:

  1. This plugin is called very early on during the process of rendering a web page; so early, in fact, that I had to come up with my own way to detect which page you are looking at. This works well as long as you are using “pretty links” (e.g. “yourdomain.com/2010/05/mypagename”) but will not work with the other type of links (e.g. “yourdomain.com/?p=5”)

  2. Only pages are currently handled. Posts could also get their own theme, but I would need to modify the plugin to support this. Just let me know if you would like to see this feature implemented.

So, if you’re interested, go get it now:
http://wordpress.org/extend/plugins/page-theme/

Comments powered by Talkyard.

Twitterified no more

Notes on enabling multisites in WP3.0

2022 The Nexus