{"_id":"543249453ee609080061800c","__v":15,"parentDoc":null,"user":"542ea80e6b0eb6080066c9d5","category":{"_id":"54e9cfb4f152c50d009b49ed","project":"5431c59ea55723080068e155","pages":["568507b4f72e9e0d00e09934"],"version":"5431c59ea55723080068e158","__v":1,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-02-22T12:46:44.278Z","from_sync":false,"order":1,"slug":"creation","title":"Tutorial"},"is_link":false,"project":"5431c59ea55723080068e155","version":{"_id":"5431c59ea55723080068e158","project":"5431c59ea55723080068e155","__v":8,"createdAt":"2014-10-05T22:26:38.927Z","releaseDate":"2014-10-05T22:26:38.927Z","categories":["5431c59ea55723080068e159","54325f53f2f806080098ad37","543264b1f2f806080098ad3e","543264c8f2f806080098ad3f","543264d3f2f806080098ad40","543264f42aca39080046d81e","5435bbf15e1b20200043834d","54e9cfb4f152c50d009b49ed"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2014-10-06T07:48:21.417Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","try":true,"basic_auth":false,"auth":"never","params":[],"url":""},"isReference":false,"order":0,"body":"[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"1. Composer.json\"\n}\n[/block]\nTo get started, go to into your template folder `wp-content/your_template/` and create a `composer.json` with these lines:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n    \\\"name\\\": \\\"your_package/your_template\\\",\\n    \\\"description\\\": \\\"\\\",\\n    \\\"type\\\": \\\"wordpress-theme\\\",\\n    \\\"minimum-stability\\\": \\\"dev\\\",\\n    \\\"require\\\": {\\n        \\\"crewstyle/tea-theme-options\\\": \\\"3.x\\\"\\n    }\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"2. Get Composer installed\"\n}\n[/block]\nJust 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:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl -s http://getcomposer.org/installer | php\\nphp composer.phar install\\n\\n# use the next command if Composer is not up to date:\\n# php composer.phar self-update\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"3. Let's roll\"\n}\n[/block]\nCheck your theme folder and see the new vendor folder created.\nIn it, you are supposed to find `composer`, `ruflin`, `twig` and `crewstyle` directories.\n\n**That's all!**\n\nThe next step is to make your theme and the **Tea Theme Options** work together.\n(And it's pretty simple... :))\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"4. Use the use\"\n}\n[/block]\nFirst of all, use the operator `use` to include the library _- at the very top -_ of your `functions.php` file:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<?php\\n\\nuse crewstyle\\\\TeaThemeOptions\\\\TeaThemeOptions;\",\n      \"language\": \"php\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"5. And create a TeaThemeOptions object\"\n}\n[/block]\nAlways in your `function.php`:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<?php\\n\\n//Include composer autoload\\nrequire_once __DIR__.'/vendor/autoload.php';\\n\\n//Instanciate a new TeaThemeOptions\\n$tea = new TeaThemeOptions();\",\n      \"language\": \"php\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"6. That's all folkes!\"\n}\n[/block]\nYour WordPress website and you are now fully prepared to use the **Tea Theme Options**.\nIt was pretty simple, uh?\n\nThe 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).\n\n__All you need is loooooooooooove__","excerpt":"","slug":"installing-the-theme-roller","type":"basic","title":"Installing the theme roller"}

Installing the theme roller


[block:api-header] { "type": "basic", "title": "1. Composer.json" } [/block] To get started, go to into your template folder `wp-content/your_template/` and create a `composer.json` with these lines: [block:code] { "codes": [ { "code": "{\n \"name\": \"your_package/your_template\",\n \"description\": \"\",\n \"type\": \"wordpress-theme\",\n \"minimum-stability\": \"dev\",\n \"require\": {\n \"crewstyle/tea-theme-options\": \"3.x\"\n }\n}", "language": "json" } ] } [/block] [block:api-header] { "type": "basic", "title": "2. Get Composer installed" } [/block] 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: [block:code] { "codes": [ { "code": "curl -s http://getcomposer.org/installer | php\nphp composer.phar install\n\n# use the next command if Composer is not up to date:\n# php composer.phar self-update", "language": "shell" } ] } [/block] [block:api-header] { "type": "basic", "title": "3. Let's roll" } [/block] 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... :)) [block:api-header] { "type": "basic", "title": "4. Use the use" } [/block] First of all, use the operator `use` to include the library _- at the very top -_ of your `functions.php` file: [block:code] { "codes": [ { "code": "<?php\n\nuse crewstyle\\TeaThemeOptions\\TeaThemeOptions;", "language": "php" } ] } [/block] [block:api-header] { "type": "basic", "title": "5. And create a TeaThemeOptions object" } [/block] Always in your `function.php`: [block:code] { "codes": [ { "code": "<?php\n\n//Include composer autoload\nrequire_once __DIR__.'/vendor/autoload.php';\n\n//Instanciate a new TeaThemeOptions\n$tea = new TeaThemeOptions();", "language": "php" } ] } [/block] [block:api-header] { "type": "basic", "title": "6. That's all folkes!" } [/block] 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__