Derived (ie, mostly completely ripped) from [http://roots.io]Roots Most of the following documentation is copied verbatim from the Roots readme
Provided by Roots boilerplate:
- Grunt for compiling LESS to CSS, checking for JS errors, live reloading, concatenating and minifying files, versioning assets, and generating lean Modernizr builds
- Bower for front-end package management
- HTML5 Boilerplate
- Bootstrap
- Organized file and template structure
- ARIA roles and microformats
- Theme activation
- Theme wrapper
- Cleaner HTML output of navigation menus
- Posts use the hNews microformat
- Multilingual ready and over 30 available community translations
Presently I've simply altered a little of the scaffolding to suit my purposes, also adding some starting templating and less structure of my own.
I like to seperate out less files and import them based on a "mobile first" approach. I import in this order:
_wp_start_defaults.less _wp_480.less _wp_768.less _wp_980.less
File for google fonts: Select fonts from google. Then get googles stylesheet and copy it into this file: _wp_fonts.less
Install the Soil plugin to enable additional features:
- Root relative URLs
- Nice search (
/search/query/
) - Cleaner output of
wp_head
and enqueued assets markup
Clone the git repo - git clone git://github.com/roots/roots.git
- or download it and then rename the directory to the name of your theme or website.
If you don't use Bedrock, you'll need to add the following to your wp-config.php
on your development installation:
define('WP_ENV', 'development');
Reference the theme activation documentation to understand everything that happens once you activate Roots.
Edit lib/config.php
to enable or disable theme features and to define a Google Analytics ID.
Edit lib/init.php
to setup navigation menus, post thumbnail sizes, post formats, and sidebars.
Roots uses Grunt for compiling LESS to CSS, checking for JS errors, live reloading, concatenating and minifying files, versioning assets, and generating lean Modernizr builds.
If you'd like to use Bootstrap Sass, look at the Roots Sass fork.
Unfamiliar with npm? Don't have node installed? Download and install node.js before proceeding.
From the command line:
- Install
grunt-cli
andbower
globally withnpm install -g grunt-cli bower
. - Navigate to the theme directory, then run
npm install
. npm will look atpackage.json
and automatically install the necessary dependencies. It will also automatically runbower install
, which installs front-end packages defined inbower.json
.
When completed, you'll be able to run the various Grunt commands provided from the command line.
N.B.
You will need write permission to the global npm directory to install grunt-cli
and bower
. You will also likely have to be using an elevated terminal or prefix the command with sudo
, i.e., sudo npm install -g grunt-cli bower
.
We also advise against running as root user. NPM deliberately uses limited privileges when executing certain commands such as those included in the Roots post-install process, and when this happens to the root user, any file system objects that are not expressly writable by the root user will fail to write during the execution of the command. These might include directories such as /var/www
or /home/someotheruser
. If you're running as root and have problems, don't say we didn't warn you.
grunt dev
— Compile LESS to CSS, concatenate and validate JSgrunt watch
— Compile assets when file changes are madegrunt build
— Create minified assets that are used on non-development environments
- Roots 101 — A guide to installing Roots, the files, and theme organization
- Theme Wrapper — Learn all about the theme wrapper
- Build Script — A look into how Roots uses Grunt
- Roots Sidebar — Understand how to display or hide the sidebar in Roots
For most structural stuff, contributions to the actual Roots or Bedrock source might be more valuable. Otherwise, I'm happy to take all contributions and feedback.
Consider that the issue you are identifying might be related to Roots rather then my addition. However, if you are certain that your issue is related to my own extension then create issues in this projects github repo.