Bootimber is a Wordpress Theme with Twig templating language provided by Timber. It's a modified fork of Timber Starter-theme with added Bootstrap 4 and Gulp automation (BrowserSync, Sass, Autoprefixer, Cssnano)
- timber & twig (Composer)
- autoprefixer 9.6.0
- bootstrap 4.3.1
- browser-sync 2.26.7
- cssnano 4.1.10
- gulp 4.0.2
- gulp-postcss 8.0.0
- gulp-sass 4.0.2"
- Install Wordpress and go to wp-content/themes/
git clone https://github.com/tomlecki/bootimber.git
or download and extract this repositorycd bootimber
composer install
- Timber installation (/vendor
folder will be created)npm install
- Gulp, Bootstrap, BrowserSync, Sass, Autoprefixer, Cssnano installation (/node-modules
folder will be created)- Activate theme in WP Admin panel
- Go to
templates/base/html-header.twig
and decide about using CDN Css or Sass, if Sass first rungulp style
to create initial/css
andapp.css
. - Use
gulp.watch
to watch for .scss and .twig changes + start BrowserSync. - Start from looking at
base.twig
to create/modify skeleton of your project. - Remember that .php files are controllers that decide which .twig file to render --> the code line starts with
Timber::render
. - You can find some examples of available variables inside
pages/page.twig
,index.twig
and filter examples inposts/single.twig
- Visit Resources at the bottom of this page.
- Change
proxy:
(line 26) to your local dev url likehttp://localhost/your-website
oryour-website.dev
- Uncomment
cssnano()
for production (optional) - first use
gulp style
to generate initial CSS, and thengulp.watch
to watch for .scss and .twig changes + start BrowserSync
/base
- files included in base.twightml-header.twig
- standard head sectionnav.twig
- Bootstrap navigation examplefooter.twig
- footer sectionscripts.twig
- CDN JS scripts
/parts
- all includes outside base.twigpagination.twig
- ready Bootstrap paginationmacros.twig
- macro exampleinclude-example.twig
- include example with variable
/pages
- main page.twig + every new page template like page-custom.twigpage.twig
- page template that renders if no page-custom.twig is found, code responsible for rendering particular .twig file can be found inpage.php
/posts
- main single.twig + every new post template like single-custom.twigsingle.twig
- post template that renders if no single-custom.twig is found, code responsible for rendering particular .twig file can be found insingle.php
base.twig
- main template file that puts together all blocks and includesindex.twig
- basic template if nothing else is foundsearch.twig
- template for search resultsarchive.twig
404.twig