Installing the theme roller

1. Composer.json

To get started, go to into your template folder wp-content/your_template/ and create a composer.json with these lines:

{
    "name": "your_package/your_template",
    "description": "",
    "type": "wordpress-theme",
    "minimum-stability": "dev",
    "require": {
        "crewstyle/tea-theme-options": "3.x"
    }
}

2. Get Composer installed

Just install now Composer and use it to download and install the Tea Theme Options with all its dependancies. To do so, follow the next command lines:

curl -s http://getcomposer.org/installer | php
php composer.phar install

# use the next command if Composer is not up to date:
# php composer.phar self-update

3. Let's roll

Check your theme folder and see the new vendor folder created.
In it, you are supposed to find composer, ruflin, twig and crewstyle directories.

That's all!

The next step is to make your theme and the Tea Theme Options work together.
(And it's pretty simple... :))

4. Use the use

First of all, use the operator use to include the library - at the very top - of your functions.php file:

<?php

use crewstyle\TeaThemeOptions\TeaThemeOptions;

5. And create a TeaThemeOptions object

Always in your function.php:

<?php

//Include composer autoload
require_once __DIR__.'/vendor/autoload.php';

//Instanciate a new TeaThemeOptions
$tea = new TeaThemeOptions();

6. That's all folkes!

Your WordPress website and you are now fully prepared to use the Tea Theme Options.
It was pretty simple, uh?

The next steps will show you how it is easy to create a menu or a custom post type with custom term (if you need it).

All you need is loooooooooooove