Best of Sage and Twig in one Theme
JavaScript PHP HTML CSS
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
assets Update with files from Sage roots/8.4.2 Mar 17, 2016
lang Sage theme - base.php replaced with base.twig Nov 15, 2015
lib Move Timber class check to the top of the file Mar 17, 2016
templates Updated post.permalink To post.link May 13, 2016
vendor Update with files from Sage roots/8.4.2 Mar 17, 2016
.bowerrc Sage theme - base.php replaced with base.twig Nov 15, 2015
.editorconfig Sage theme - base.php replaced with base.twig Nov 15, 2015
.gitignore Update with files from Sage roots/8.4.2 Mar 17, 2016
.jscsrc Sage theme - base.php replaced with base.twig Nov 15, 2015
.jshintrc Sage theme - base.php replaced with base.twig Nov 15, 2015
.travis.yml Sage theme - base.php replaced with base.twig Nov 15, 2015
404.php Moved all PHP templates files into Twigs Nov 16, 2015
CHANGELOG.md Update with files from Sage roots/8.4.2 Mar 17, 2016
CONTRIBUTING.md Sage theme - base.php replaced with base.twig Nov 15, 2015
LICENSE.md Sage theme - base.php replaced with base.twig Nov 15, 2015
README.md Updated Readme documentation Mar 17, 2016
bower.json Update with files from Sage roots/8.4.2 Mar 17, 2016
composer.json Sage theme - base.php replaced with base.twig Nov 15, 2015
composer.lock Update with files from Sage roots/8.4.2 Mar 17, 2016
functions.php Update with files from Sage roots/8.4.2 Mar 17, 2016
gulpfile.js Update with files from Sage roots/8.4.2 Mar 17, 2016
index.php Moved all PHP templates files into Twigs Nov 16, 2015
package.json Update with files from Sage roots/8.4.2 Mar 17, 2016
page.php Moved all PHP templates files into Twigs Nov 16, 2015
ruleset.xml Sage theme - base.php replaced with base.twig Nov 15, 2015
screenshot.png Sage theme - base.php replaced with base.twig Nov 15, 2015
search.php Moved all PHP templates files into Twigs Nov 16, 2015
single.php Moved all PHP templates files into Twigs Nov 16, 2015
style.css Bumped version number to 1.0.1 Mar 17, 2016
template-custom.php Moved all PHP templates files into Twigs Nov 16, 2015

README.md

Sage + Twig theme for Wordpress

Sage is a WordPress starter starter theme with a modern front-end development workflow. Twig is a modern template engine.

The Sage + Twig starter theme combines the best of both.

Do check out the Timber Wiki. It will help you to learn Twig and how to set it up with Wordpress.

Theme installation

Clone the git repo - git clone git@github.com:studiorabota/sage-twig-theme.git and then rename the directory to the name of your theme or website.

Theme setup

Edit lib/setup.php to enable or disable theme features, setup navigation menus, post thumbnail sizes, post formats, and sidebars.

Installation

You will need:

  • Gulp
  • Bower
  • Composer
  • Node - We recommend you update to the latest version of npm: npm install -g npm@latest.

From the command line:

  1. Navigate to the theme directory, then run npm install
  2. Run bower install
  3. Run composer update to install the Timber plugin
  4. Run gulp
  5. Open assets/manifest.json and set devUrl to your domain name (ex. project-name.dev)
  6. Run gulp watch
  7. Go to Plugins in wp-admin and activate Timber

You now have all the necessary dependencies to run the build process.

Adding extra data to Twig

In lib/timber.php you can add extra data to be used in your Twig templates. This is only for data which needs to be available site-wide, like menus, etc.

You can also add data in for ex. page.php, archive.php, etc. For this you should check out the Timber documentation.

Using BrowserSync

To use BrowserSync during gulp watch you need to update devUrl at the bottom of assets/manifest.json to reflect your local development hostname.

For example, if your local development URL is http://project-name.dev you would update the file to read:

  "config": {
    "devUrl": "http://project-name.dev"
  }

Documentation