On: 2005/09/03 Viewed: 238070 times

What is it exactly ?

Wordpress Theme Toolkit is just a set of 2 PHP files you will drop into your theme directory (see Page 4 for download links)

  • themetoolkit.php : the class definition. You'll never need to do anything with it. Put it in the directory, forget about it.
  • functions.php : this small file contains the few things you will edit.

So, how easily ?

Ready for a 3 minutes tour ? Let's create our admin menu. Say we are working on a theme named, how original, "My Neat Theme", which would sit in wp-content/themes/mytheme.

  • Step 1
    Put the required files functions.php and themetoolkit.php in your theme directory.
  • Step 2
    File functions.php looks like this :

    CODE:
    1. <?php
    2. include(dirname(__FILE__).'/themetoolkit.php');
    3.  
    4. themetoolkit(
    5.     'mytheme',
    6.    
    7.     array(
    8.         'option1' => 'Text for Option One',
    9.         'option2' => 'Text for Option Two',
    10.         'option3' => 'Text for Option Two',
    11.     ),
    12.  
    13.     __FILE__   
    14.  
    15. );
    16. ?>

    First line is where the class definition is included. Nothing to edit here.

    Then, a function call with three parameters : themetoolkit(), which is passed a theme name, an array of options, and PHP predefined constant __FILE__. Leave this last parameter untouched, edit the first two to suit your needs.

  • Step 3
    (This step is not required with Wordpress 2.0, but is for WP 1.5 compatibility. Once the whole world will have switched to 2.0, you can just skip it !)
    Add this line to your template header.php :

    CODE:
    1. <?php include_once(dirname(__FILE__) . '/functions.php'); ?>

    Now load your blog with your theme enabled.

And that's about it.

And what did that do ?

These three steps produced a few things :

  • Now, in the Themes admin area, we have another menu added. Just like a plugin adds a menu, except that this time your theme did the job.Theme Toolkit : menu added !
  • Let's click on this menu : here is your theme control panel ! The three lines you edited created a menu, nicely integrated within Wordpress admin area, ready to accept some input from theme users. (click image to enlarge) Theme Toolkit : admin menu example

Now what ?

From now on, everything you will input in the admin menu you've just created will be stored in a array of variables, named $mytheme->option. For example, if you enter in our 3 input fields the values "value1", "43", "some other text", the following array will be available :

CODE:
  1. $mytheme->option['option1'] = "value1"
  2. $mytheme->option['option2'] = "43"
  3. $mytheme->option['option3'] = "some other text"

What you "just" have to do now is create your own functions, add features to your theme that will use these values the user can input. Look below in section "Examples and Ideas" to see what you could use this for.

Related posts

Page: #1 #2 #3 #4 #5

Metastuff

This page "Wordpress Theme Toolkit" was posted on 03/09/2005 at 2:36 pm
Watch this discussion : Comments RSS 2.0. You can trackback this post from your own site

148 Blablas

    Pages: « 1 2 3 4 5 6 7 [8] Show All

  1. 141
    Motti Israel »
    said, on 29/Jun/08 at 11:08 am # :

    Just wanted to say thank you for that wonderful Kit.

  2. 142
    Braincast » Storelicious» Pr... United States »
    pingback on 01/Jul/08 at 11:07 am # :

    [...] Theme ToolKit [...]

  3. 143
    RodeWorks » WordPress Theme Toolki... United States »
    pingback on 01/Jul/08 at 1:28 pm # :

    [...] Wordpress Theme Toolkit « planetOzh [...]

  4. 144
    Nuevo Theme para mi blog | Omar Corrales... United States »
    pingback on 03/Jul/08 at 4:54 am # :

    [...] pensado liberar el theme WP-Resurrection pero como queria añadirle algunas opciones intente usar Wordpress Theme Toolkit pero tuve algunos errores con el y la verdad no soy tan experto en PHP como para arreglarlo. [...]

  5. 145
    The P! Company - iamnotagoodartist United States »
    pingback on 04/Jul/08 at 5:41 am # :

    [...] their latest sketch shoved down the throat of their visitors. With some help from planetOzh’s Theme Toolkit, I put together a YouTube embed box that can be easily changed from the admin [...]

  6. 146
    Agregar Opciones a tus themes | Omar Cor... United States »
    pingback on 09/Jul/08 at 12:32 pm # :

    [...] Theme Toolkit Puede ser el mas conocido de todos, Lo use en versiones anteriors de wordpress, pero ahora me da error. Puede ser por mi poco conocimiento de PHP, pero es muy bueno! [...]

  7. 147
    cet Sweden »
    thought, on 14/Jul/08 at 9:12 pm # :

    i cant do it.

  8. 148
    Minyx 2.0 - Theme Wordpress — Simp... United States »
    pingback on 19/Jul/08 at 8:23 pm # :

    [...] Theme ToolKit [...]

Pages: « 1 2 3 4 5 6 7 [8] Show All

Leave a Reply

Comment Guidelines or Die

  • HTML: You can use these tags: <a href=""> <em> <i> <b> <strong> <blockquote>
  • Posting code: Post raw code (no <> &lt; etc) within appropriate tags : [php][/php], [css][/css], [html][/html], [js][/js], [sql][/sql], [xml][/xml], or generic [code][code]
  • Gravatars: Curious about the little images next to each commenter's name ? Go to Gravatar.
  • Spam: Various spam plugins on patrol. I'll put pins in a Voodoo doll if you spam me.
  • I will mark as Spam test comments, all comments with SEO names (ie "My Cool Online Shop" instead of "Joe") or containing forum-like signatures.

Close
E-mail It