Roots Theme homepage | Documentation table of contents
The HTML, CSS and JavaScript in Roots comes from a combination of HTML5 Boilerplate and Twitter Bootstrap.
A basic Roots theme initially looks like this:
.
├── assets
│ ├── css
│ │ │── app.css
│ │ │── bootstrap.css
│ │ │── bootstrap-responsive.css
│ │ │── editor-style.css
│ ├── img
│ ├── js
│ │ ├── main.js
│ │ ├── plugins.js (includes bootstrap.js)
│ │ └── vendor
│ │ ├── jquery-1.9.1.min.js
│ │ └── modernizr-2.6.2.min.js
│ └── less
│ │ │── bootstrap.less
│ │ └── responsive.less
├── doc
├── lang
│ └── roots.pot
├── lib
│ ├── activation.php
│ ├── cleanup.php
│ ├── config.php
│ ├── custom.php
│ ├── init.php
│ ├── nav.php
│ ├── rewrites.php
│ ├── scripts.php
│ ├── sidebar.php
│ ├── utils.php
│ └── widgets.php
├── templates
│ ├── comments.php
│ ├── content.php
│ ├── content-page.php
│ ├── content-single.php
│ ├── entry-meta.php
│ ├── footer.php
│ ├── head.php
│ ├── header.php
│ ├── header-top-navbar.php
│ ├── page-header.php
│ ├── searchform.php
│ └── sidebar.php
├── 404.php
├── base.php
├── functions.php
├── index.php
├── page.php
├── screenshot.png
├── single.php
├── style.css
└── template-custom.php
What follows is a general overview of each major part and how to use them.
This directory should contain all your project's CSS files. If you're using LESS, you should have less/bootstrap.less
compile to css/bootstrap.css
, and less/responsive.less
compile to css/bootstrap-responsive.css
. Any additional LESS files that aren't from Bootstrap should compile to css/app.css
.
This directory should contain all your project's image files.
This directory should contain all your project's JS files. Libraries, plugins, and custom code can all be included here. It includes some initial JS to help get you started.
The files and directory structure are adopted from HTML5 Boilerplate's JavaScript.
This directory contains all the Roots documentation. You can use it as the location and basis for your own project's documentation.
This directory contains all of the theme translations. About translating the theme.
This directory contains all of the theme functionality. About the theme library.
This directory contains all of the theme templates. About the templates.
A helpful custom 404 to get you started.
This is the default HTML skeleton that forms the basis of all pages on your site. About the theme wrapper.
This file loads all of the theme library files, sets up the default navigation menus, and adds support for post thumbnails.
This file is used to serve all of the archive templates.
This file is used to serve the page template.
This file is used to serve the single post template.
This file is used to tell WordPress that we're a theme. None of the actual CSS is contained in this file.
An example of a custom page template. By default, this page is full width and doesn't contain a sidebar as defined in lib/config.php
's roots_sidebar()
function.