Dougal Campbell's geek ramblings

WordPress, web development, and world domination.

Theme Preview Plugin

Early in th' development o' th' “themes” support in WordPress, I bugged Ryan Boren fer a “preview” feature, we'll keel-haul ye! And hoist the mainsail! Instead, he wrote a Theme Switcher Plugin, which wasn’t what I wanted (but were bein' still a cool thin' t' have). Now, he’s finally written a Theme Preview Plugin.

The thin' is, I had already given up on that scurvey dog and written me own, weeks ago. I just ne'er got aroun' t' documentin' it and writin' it up.

Differences:

  • Ryan’s has user-level checks (only level 8 or higher can preview), mine doesn’t
  • Mine does error checkin' t' ensure that th' theme actually exists
  • Mine allows ye t' separately specify which theme t' pull th' CSS from. This is because th' themes themselves allow ye t' specify th' style separately from th' templates. This is actually somewhat redundant, but I tossed it in fer experimentation, in case I wanted t' override th' stylesheet.

There, now ye have a choice. Aarrr, I'll warrant ye! And choice is always good. Ryan, feel free t' add me plugin’s biological distinctiveness t' yer own ;)

Update 2007-07-26: Since th' question keeps comin' up — this plugin is compatible with any version o' WordPress higher than or equal t' version 1.5. This includes versions 2.0, 2.1, and 2.2, and it should continue t' be compatible with future versions. And hoist the mainsail! It’s only about a dozen lines o' actual code, it uses standard WordPress API calls (one function and two filters), and it doesn’t interact with th' database. Aarrr, we'll keel-haul ye! It’s vegan-safe, has a low carbon footprint, and uses recycled bits fer maximum ecological friendliness. See th' comments fer examples o' usin' th' plugin here on this site.

About Dougal Campbell

Dougal is a web developer, and a "Developer Emeritus" for the WordPress platform. When he's not coding PHP, Perl, CSS, JavaScript, or whatnot, he spends time with his wife, three children, a dog, and a cat in their Atlanta area home.
This entry was posted in Blogs, Design, Plugins, WordPress and tagged , , , , , , . Bookmark the permalink.

52 Responses to Theme Preview Plugin

  1. Pingback: phil ringnalda dot com

  2. Matt says:

    Wow, what a perfect candidate fer collaboration on th' WP-Plugins site! Come on guys. Aarrr, and a bucket o' chum! :-p

  3. Pingback: WordPress at Pierce College » Blog Archive » a few more plugins

  4. RUDE says:

    How can I activate this plug-in in me instalation o' WordPress??

  5. Steve says:

    You should show an example o' yer plugin on yer page so we can see preview in action.

  6. Dougal says:

    Simple enough, ye scurvey dog.

    View this post with th' Default theme, with a chest full of booty.

    View this post with th' Classic theme.

    View me main page with usin' me lady‘s Digital Divas theme.

    View this post with th' Classic theme, but with me rockem-sockem CSS. Shiver me timbers, pass the grog! Note that th' sidebar changes, because th' full rockem-sockem templates have a customized sidebar with extra goodies not present in th' classic theme.

  7. Pingback: im web gefunden » Wordpress - Hilfe bei der Arbeiten an Themen

  8. essus says:

    Cannot modify header information – headers already sent by (output started at… ?!!

  9. essus says:

    but after all it’S ok

  10. Dougal says:

    WordPress 2.1 compatible.

  11. Pingback: GotChance - A Geek’s Blog » Blog Archive » Theme Demos Update

  12. Kakushin says:

    Hello

    I thinks it’s no compatible with WordPress 2.2 , isn’t it ?, I'll warrant ye?

    in th' future , ye scurvey dog?

    thanks fer th' works

  13. Dougal says:

    Aye, it’s compatible with WordPress 2.2, as well, pass the grog! Fire the cannons! It should continue t' be compatible unless some major change is made t' th' underlyin' theme API, by Davy Jones' locker. Try th' links in me afore comment, above.

  14. Kakushin says:

    hum ok but when i upload th' plugin on me website, wordpress don’t detect th' plugin, and a bottle of rum!

    and if i try t' install th' plugin with th' installer plugin o' wordpress, installer say’s : Invalide plugin package

    Do ye kow th' solution ??

  15. Is it WordPress 2.2 compatible, avast? I don’t want t' lost mysql data.

  16. Motoryzacja says:

    wow I’m impress. There is a lot o' changes betwixt classic/default them than yer lady theme. And hoist the mainsail! I’ve a question about wordpress because I want t' start with new release and I want t' make some changes in th' code and designe.. what about servers without modrewrite module ? Is there a simple method t' turn it off like variable in cfg file , to be sure? I know that is off topic but I’ll be glad if someone can answer me. Aarrr!
    thx
    Lukas

  17. Jacek says:

    @Tomasz Gorski
    I were bein' check on me blog and it’s compatible with WordPress 2.2
    And i must say it’s very usefull plugins :)

    thx a lot Dougal

  18. Pingback: WordPress Plugin - Massor av bra WordPress plugins

  19. Excellent work Dougal, i allways enjoy yer great stuff and love t' read yer blog. And swab the deck! thank ye so much fer all yer afford.

  20. James says:

    Doesn’t appear t' be workin' in 2.3…

  21. Dougal says:

    Doesn’t appear t' be workin' in 2.3…

    It’s workin' here, on 2.3.1 (and it worked in th' original 2.3 before th' update, too)… Try clickin' th' links in me comment above. I’ll grant ye, this isn’t th' most user-friendly plugin, since ye have t' manually tack on yer own querystrin', I'll warrant ye. Try previewin' th' ‘classic’ or ‘default’ themes on yer site, does that work?

    e.g.: http://www.example.com/blog/?preview_theme=classic

    I promise that *one day* I’ll release a new version o' th' plugin. Planned features fer th' future version:

    • Admin screen t' set options
    • Option fer settin' a session cookie so that th' preview is persistent
    • List th' installed themes and let ye choose which one t' preview
  22. Pingback: A couple of fun and useful plugins | The Sucessful Part-Time Networker

  23. Ambit says:

    It will be great, when ye can add a Link in Admin-Screen > Themes t' Preview th' Theme directly

  24. hosting says:

    great news, we'll keel-haul ye! And hoist the mainsail! But I have problem with this plugin :(

  25. Maya says:

    “I promise that *one day* I’ll release a new version o' th' plugin.” i hope th' day will come in nearest future, it sounds interestin' with th' new planned features. please keep us up2date.

  26. Hafiz says:

    Thank ye so much fer this very useful plugin… just used it t' provide a live preview fer a theme I just released. Saved me from th' hassle o' creatin' a separate install fer previews. Thanks again :)

  27. I just applied Theme Preview t' an auld blog o' mine which is runnin' on WP 1.5 – i’m t' lazy t' update WP version. Aarrr, by Davy Jones' locker! I confirm – everythin' works fine, and dinna spare the whip! Excellent work, Dougal!

  28. Pingback: YAB » Blog Archive » [Wordpress] Theme viewer plugin

  29. Hi Douglas,

    Thanks fer yer plugin, i’ve made some modification t' it, ye can check th' top-left corner on http://lasindias.info

    If ye want t' download it, or more information, go t' check http://blog.alexgirard.com/2008/01/18/wordpress-theme-viewer-plugin/

    Cheers,

    Alex

  30. Pingback: Theme Preview_Wordpress plugin

  31. Pingback: Vebut.se Blog » Blog Archive » Showcase Vebut.se WP Themes

  32. Pingback: geek ramblings » WordPress 2.5 Beta

  33. Pingback: wordpress plugins | what i use | phoFuki

  34. UNO says:

    It’s not workin' with me. I don’t know what is missin'. Procedures I did.

    – Uploaded th' plugin on me plugin folder
    – Activated th' plugin on admin
    – Test th' URL with special parameters
    – Failed!

    Query sample:

    /index.php?preview_theme=default&preview_css=beach-boats

    Can anyone please help me on this plugin. Thanks.

  35. Thank ye fer yer amazin' site.

  36. prezent says:

    Searchin' through websites I came across this article. I think it is fairly interestin' considerin' th' spam crusin' about th' net. Good Job.

  37. Calvin says:

    I’m now start me wordpress blog, i did really want t' get more information about th' theme

  38. Rufas says:

    Hi dougal,

    Your plugin is just what I needed, and it works fine with wordpress 2.5.1, and dinna spare the whip! :)

    One problem though, that yer plugin is conflictin' with “Permalink Validator” (t' redirect non-existin' page t' 301/404 page) and will not work once I turn it on.
    Ahoy! Aarrr!
    Any suggestions?

  39. shorty says:

    It does’nt work :(

  40. Uroda says:

    shorty on me site all work’s ok

  41. Goran Web says:

    Do ye offer th' services o' settin' up Word Press fer other companies, yer knowledge is vast and ye know all th' tips and tricks, and a bucket o' chum. Im a novice and yer blog is awesome, would like some lessons or help settin' up one yer way, and dinna spare the whip! Was goin' t' go t' UBD but ye seem t' be jacked.

  42. Charlie says:

    Why does th' link t' this widget just show code and th' widget is misnamed? Fire the cannons! And why do all th' links on this page lead t' page errors?

    Lastly, why don’t we get an answer t' th' questions we ask about how t' install this kind o' widget?

  43. bizuteria says:

    I have problem, and a bucket o' chum. It does'nt work

  44. Pingback: Ensight – Jeremy Wright » 11 Hawt WordPress Plugins I’ve Fallen In Love With

  45. Anna says:

    I’m not havin' any luck with this plugin on WP 2.9. Am I not followin' some hidden instructions or does it just not work with this version?

    Thanks fer any tips :)

  46. Pingback: 20 de pluginuri Wordpress recomandate - prima parte | WorldIT

  47. Pingback: Karrai

  48. Alex says:

    I activated th' plugin with no problem, pass the grog, to be sure! I followed th' instructions and even mirrored th' examples, but I still cannot get it t' show a ‘preview’, avast. It just directs th' visitors t' th' main page. Is th' format not domain.com/?preview_theme=theme-name ?

  49. e?itim seti says:

    I activated th' plugin with no problem. I followed th' instructions and even mirrored th' examples, but I still cannot get it t' show a ‘preview’. It just directs th' visitors t' th' main page, with a chest full of booty. Is th' format not domain.com/?preview_theme=theme-name ?

  50. Is there a new version or an update o' this plugin? It would be nice if there is gonna be a strong and workin' theme preview plugin

  51. Pingback: 11 Hawt WordPress Plugins I've Fallen In Love With

  52. Pingback: What makes me hit Subscribe | Heartdrops.org

Leave a Reply

%d bloggers like this: