On: 2005/09/03
Shorter URL for this page: http://ozh.in/ko

In every WordPress theme there are places that are supposed to be edited and customized by the end user who is using the theme : an "About you" block to fill in, a loop to customize when you want to add "Asides" post style, some CSS to tweak to use an personal image in header, etc…

The problem is : most bloggers are not PHP or HTML expert, can't tell the difference between an HTML tag and a PHP tag, and simple editing of templates can be hazardous and tedious to them. Adding an admin menu in your theme ensures that end users can customize things without editing source files, just as naturally as changing a WordPress option in the admin area.

WordPress Theme Toolkit is a PHP class that gives WordPress theme authors the opportunity of creating a persistent admin menu for their theme as easily as editing 3 lines in a file.

You are a theme author ? Have enough skills to edit three lines ? Add an admin menu to your theme ! (click to enlarge)
Theme Toolkit : admin menu example

Just to be sure : WordPress Theme Toolkit is not a theme with an admin menu. It is something that makes adding an admin menu to an existing theme as easy as 1-2-3.

This long article is divided in shorter sections :

  1. Intro : well, here.
  2. Overview : a quick tour about features and how easy things are.
  3. Manual : detailed features and how-to
  4. Download ! : files and credits.
  5. Ideas and Examples : suggestions and ideas of what you could add to your theme … and a real WordPress Theme as an example of use.
Page: #1 #2 #3 #4 #5

Shorter URL

Want to share or tweet this page? Please use this short URL: http://ozh.in/ko

Metastuff

This page "WordPress Theme Toolkit" was posted on 03/09/2005 at 2:36 pm
Watch this discussion : Comments RSS 2.0.

196 Blablas

  1. Azmeen says:

    Rudd-O,

    You could try something like:

    http://domain.tld/?var=test&anothervar=something

    Can't preview… hope this works.

  2. Azmeen says:

    Bargh… my last comment didn't display as it's supposed to. Hope this clarifies things.

    Basically, you just double the amp bits, ie. if you want to display: […]&test=1[…] you type (but remove the space after the first ampersand, of course):
    […]& amp;amp;test=1[…]

    Should work pretty well.

  3. […] It now fully incorporates the WordPress theme toolkit into the package; thus, ad display code and other options are now completely configurable via the theme options page on the WordPress administrative interface […]

  4. […] Several customization options (thanks to the wonderful WordPress Theme Toolkit by Ozh) […]

  5. Olaf says:

    Theme Toolkit is so amazing, thank you Ozh! I`ve created the Sirius theme and it provides a lot of design options in the admin panel. Thanks to Toolkit I could comfortably realize this theme.

    Information and download link under:
    http://blogshop.de/21022006,497/2/

  6. […] Well I have been messing with WordPress Theme Toolkit Admin Menu today and created an updated version of my previous Exquisite theme. The toolkit is really great. […]

  7. Lisa says:

    I thought I posted this already, but I must not have pressed submit.
    anyway, I love this plugin – It will work wonders for me and my users, but it is not working well for me. I am sure it is operator error, so please go easy on me!
    I am using the fauna theme for my blog, http://www.lisa.scribblesonline.com/blog/ and have found the options to change stuff using the themetoolkit editor. I can change the sidebar placement, can hide the links etc. But, when I tried to change the header graphic to a custom image hosted on my site, I get a light gray image.
    Also, when I try to use themetoolkit with other themes, I am not able to change anything, the header image, the sidebar placement and other options.
    any help is greatly appreciated!

  8. Ozh says:

    Lisa » these are theme issues, contact authors of the themes that are using my Toolkit.

  9. Lisa says:

    ok, I can do that, but the themetoolkit was not something that they packaged with the theme, I added it to the theme, so I doubt that they will be inclined to help.
    but thanks for the suggestion.

  10. […] Just found out that Ozh has created a WordPress Theme Toolkit which, upon editing three lines of code in any existing theme, will provide Theme Authors with an admin menu accessible through the WordPress Presentation UI.  Very cool stuff — all would-be wordpress theme authors should check it out!  Same goes for those of you dabbling in modifying existing themes.  Nice work Ozh! Filed under blogging, Weblogs, WordPress, Templates, Themes, wordpress theme toolkit by Emily from How to Blog. Permalink • Print • Email […]

  11. Adri says:

    Fantastic tool with excellent documentations!

  12. […] Ozh added "default options" to his themetoolkit That means Fauna now populates the options page with the default options. This makes it easier for you to see what'll happen when you change those options. […]

  13. jimy says:

    Cool cool tool! Thank u! I am going to try it for my themes (:

  14. […] Fixes: » Moved all font css to fauna-default.css » Wrote some instructions in the top of fauna-default.css » Added an option to specify a custom stylesheet. This might make it easier to upgrade to future versions of Fauna. » Dropped category RSS meta link, since the code wasn’t 2.0 compatible » Due to incredible work by Ozh on his Themetoolkit (http://planetozh.com/blog//my-projects/wordpress-theme-toolkit-admin-menu/), checkboxes now function properly. Ozh has actually made a workaround to a bug in WordPress itself. Send him a thank you note. » Removed a superfluous DIV from page.php and page-archives.php (Thanks Levi) » Added a few HTML comments in some of the templates, including search.php (Thanks Levi) » Fixed a problem in template-postloop.php where uncommenting the_author_link wouldn’t work (Thanks Sadish) » Fixed a problem in template-sidenote.php where it said “1 Comments” (Thanks Sadish) » Had to add class “post” to template-sidenote.php and template-postloop.php in order to fix an overflow problem » Added some default values to the options page. This means the default configuration for Fauna is now actually shown in the options page, rather than the options being empty as they have been so far » Changed noteworthy heart font to Lucida Console, because it looks really good in that font. » Moved an .entry-date border style from style.css to fauna-default.css » Moved a yellow inputfield focus class to fauna-default.css (Thanks Levi) » Fixed a nasty bug where sites with more than one author would have author pages with errors on them (Thanks a lot, Levi) » Made consistent vertical spacing in UL lists in the sidebar (Thanks Simplex) » Did some tweaks to the header width / height options so you can change the header of the all mastheads, not just custom ones » Added option to change background image and color » Removed the searchbox background. I’ve been pondering this for ages. While it did serve the purpose of connecting above with below, visually, I think it looks a bit better without. Your thoughts? » Due to popular demand, I added another special category: Sidenotes. To do this, I renamed the previous “Sidenotes” category to “Asides”. Now it works like this: “Asides” or “Dailies” are small posts in the main post-list, while “Sidenotes” are relegated to the sidebar. For those of you who are using a “Sidenotes” category for your small posts in the main post-list and don’t want those relegated to the sidebar, simply go “Manage > Categories”, and in the “Category slug” for your Sidenotes category, type in “asides” or “dailies”. Then you’ll keep your behaviour. –> […]

  15. jsekera says:

    Wow this is a fantastic tool – well done.

    I have an oddness that’s happening on the back end, and I wanted to run it by you. When I have an item that uses a checkbox, more often than not when I toggle that element (within the admin interface) it doesn’t take the first time, in fact sometimes they take three times to actually register. The other items (radio & text box) don’t seem to have this problem. Am I doing something stupid here, is there a caching issue with this element, or is there something else at work?

    Also – do you have any plans to add dropdown’s to the list of available elements?

    – Thank you – JS

  16. Blogzor says:

    Is it possible to add a way that the size of the textbox could be configured? Something like {10,20} size/max. It does not look like their is any sanitizing done on the user input. Could this be vulnerable to xss attacks? Thanks for this great tool.

  17. […] The work of Ozh, specifically the WordPress Theme Toolkit has helped theme developers come up with interesting ways to manage sidebars, may they be horizontal or vertical. Kyle Neath used the same toolkit when he made the Hemingway theme. […]

  18. Ron says:

    Hi, I istalled the 'Tiga' theme and it includes your plug-in. It is installed on WP1.5.1.3.Everything is installed as per instructions. Repeatedly. The problem is that this warning appears;

    Fatal error: Call to undefined function: add_theme_page() in /home/ronpembe/public_html/wp-content/themes/tiga/themetoolkit.php on line 84

    I am still a newbie to PHP; which I only started learning a year ago. Could you please tell me what this could be?

    Thanks in advance

    Ron

  19. hadi farnoud says:

    i've got this error when use minimalistic theme,
    Fatal error: Call to undefined function add_theme_page() in /home/users/farnoud/wp-content/themes/minimal/themetoolkit.php on line 84

  20. […] WordPress Theme Toolkit […]

  21. Scott says:

    I've just rereleased two of my themes and a new theme all of which use the WordPress Theme Toolkit. I'm not a coder nor a designer by any means, but I found this tool very, very useful and pretty easy to get a grasp on and use effectively. Well done.

    plaintxt.org » Themes

  22. felipe.lavin says:

    Excellent work!

    I have a question: how can I pass some variable through the "texturize" filter?

    For instance, I've created an "About" textarea, but I would like that the contents of that textarea could be "texturized", to add paragraphs and breaks. Is this posible?

  23. Ozh says:

    Felipe » well instead of echo($stuff) you just echo wptexturize($stuff) …

  24. felipe.lavin says:

    Thanks!

    Actually, what I was looking for was wpautop($stuff); that's the filter that manages paragraphs and breaks… just in case anyone was wondering :P

    Once again, great work!

  25. Scott says:

    Hey Ozh: I've had a lot of luck with the toolkit—awesome. I am, however, going nuts trying to figure something out with my limited PHP/MySQL knowledge.

    I have a home.php with two layouts. Depending on a checkbox in theme options, one is used with a specific post/page, like a CMS. I've made the two layouts, but I can't figure out how to make an option for a page slug to be entered and then placed in the query_posts('pagename=X').

    I would greatly appreciate any help.

    Thanks.

    scott

  26. Scott says:

    Ozh rocked my query from above. Thanks, Ozh. The WP Theme Toolkit has made my themes better. No! it has made my themes actually usable. Thanks for this.

  27. Ozh says:

    Scott » you're welcome :) keep releasing neat themes !

  28. felipe.lavin says:

    Hi, it's me again… I just wanted to know if there is any license protecting your work… the thing it's I'm thinking of release a theme with a GPL license, but that license shouldn't include your work, would it? So… what kind of license should be stated as protecting the theme toolkit?

  29. Ozh says:

    Felipe » GPL is fine. To be honest, I don't even care about this. I always have the feeling that whenever you release some code, well, it's more or less getting public domain. The only thing that I care about is that whenever a theme author releases a new theme using the toolkit, I'm notified (trackback, link, mail) about it. That makes my day :)

  30. Karthik says:

    hey i am designing a theme and i wanted a query like this to be generated.. in a function called mytheme_asides()

    // query_posts('category_name="asides"&showposts=4');

    how do i do it.. i want "asides" to be replaced by $mytheme->options['asides'] and 4 to be replaced by $mytheme->options['asides_num']..

    please help me out..

  31. aseed says:

    Great job merci beaucoup
    sympa knorr ;-)

  32. sapinto says:

    crystal.

    nice work dude ;)

  33. John says:

    Thank you so much. I am no expert with php and the toolkit has give me loads of options to edit my own blog. This is such a great tool and thank you again!

  34. Eugen Tuning says:

    Ozh , thanks for tool, great idea. downloaded and installed, but must test in my testblog :)

  35. arena says:

    Bonjour,

    j'ai juste rajouté ces quelques lignes dans la fonction print :

    case 'select':
    print $matches[1]."\n";
    print "";
    while ($items) {
    $v=array_shift($items);
    $t=array_shift($items);
    $selected=";
    if ($v == $this->option[$key]) $selected=' selected';
    print "$t\n";
    }
    print "";
    break;

    et ca marche !!!!!!!!

  36. […] The sidebar is fixed (static), but the header and content-area are fluid to accommodate different sized screens/browsers. I included the WordPress Theme Toolkit by Ozh for user-friendliness. For style and functionality I have included some plugins: jspullquotes by Viper007Bond (for the cute magazine-style pullquotes), Sociable by Peter Harkins (adds Social Bookmarking links to the end of each post), Live Comment Preview by Jeff Minard and Iacovos Constantinou, Optimal Title by Aaron Schaefer (reverses order of post-title/blog-title for SEO/Search friendliness) and Related Posts by By Alexander Malov & Mike Lu (lists related posts at the end of each post). […]

  37. […] Here is a newsletter-style 2-column with sidebar theme for WordPress which allows some control over which categories are displayed in each column. I included the WordPress Theme Toolkit by Ozh for user-friendliness. This theme is a modified version of Corporate Slave, by dreamLogic . […]

  38. […] Now distributed with multiple colors schemes – blue, pink, green, brown, red, and orange – controlled via the Theme Presentations tab thanks to the WordPress Theme Toolkit. […]

  39. […] Usamos WordPress Theme Toolkit […]

  40. […] Cada segundo que paso online significa incorporar un nuevo conocimiento: desde la lectura del diario ni bien me levanto, hasta aprender a usar el wordpress theme toolkit para ponerselos a mis themes. Desde leer las principales tres revistas medicas todos los días hasta la verdadera historia de Jean y Dark Phoenix. […]

  41. I use your toolkit in my CMS theme. Thanks for creating and sharing this nice tool. A suggestion: it would be nice to be able to add a dropdown list based in a query in the options.

  42. […] Now distributed with multiple colors schemes – blue, pink, green, brown, red, and orange – controlled via the Theme Presentations tab thanks to the WordPress Theme Toolkit. […]

  43. Infected-FX says:

    Hi, i'm new using this great featured for themes, but i have a question in the implementation for this.

    I am trying to use conditional for the functions, if they exist that they are and but that they show another thing, but me it does not respect it.

    For example i have a function call inphecthyuz_codeone in my theme put this


    < ? php if (function_exists('inphecthyuz_codeone')) : ? >
    < p >< ? php inphecthyuz_codeone(); ? > < /p >
    < ? php else : ? >
    < h2 >the other thing here
    < ? php endif; ? >

    any idea? :( pls!!

    Thank you!! :) and greetings.

  44. Kipit says:

    To use it with WPmu (Worpress-Multiuser), as $wp_version='wordpress-mu-1.0′ , drop WP 2.0 (and 1.0) specific code, assuming that current version of WPmu is based upon WP-2.0

  45. Ozh says:

    InfectedFX » your PHP code is correct. The thing is, function_exists is sometimes a bit touchy : at compilation time, PHP sometimes doesn't know if the function will exists or not. This can typically happen when your function_exists test is enclosed in another test, or a class.

    However, there is no reason why a function you're defining in your theme would not exist. So I'm not sure you really need this test :)

  46. Money From says:

    The more code that is added the slower everything will start to run though correct or am I wrong? Is it a noticable shift in performance?

  47. Ozh says:

    MF » take a look at how many thousands of lines of code are run in WP every time a page is loaded. Adding a single 40 line class and 20 lines of functions code is… nothing :)

  48. test says:

    Sehr gut!

  49. Andy Wibbels says:

    Toyed with getting a option type for dropdown menus. Here's what I came up with – still testing it:

    case 'dropdown':
    print $matches[1]."\n";
    print "";
    while ($items) {
    $v=array_shift($items);
    $t=array_shift($items);
    $checked=";
    if ($v == $this->option[$key]) $checked='selected';
    print " $t";
    if (@$items) print "\n";
    }
    print "";
    print "";
    break;

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>
Gravatars: Curious about the little images next to each commenter's name ? Go to Gravatar and sign for a free account
Spam: Various spam plugins may be activated. I'll put pins in a Voodoo doll if you spam me.