This is a starter-theme for WordPress based on Foundation 6, the most advanced responsive (mobile-first) framework in the world. The purpose of Foundation, is to act as a small and handy toolbox that contains the essentials needed to build any design. Foundation Theme is meant to be a starting point, not the final product.
Please fork, copy, modify, delete, share or do whatever you like with this.
All contributions are welcome!
This project requires Node.js v4.x.x to v6.9.x to be installed on your machine. Please be aware that you will most likely encounter problems with the installation if you are using v7.1.0 with all the latest features.
Foundation Theme uses Sass (CSS with superpowers). In short, Sass is a CSS pre-processor that allows you to write styles more effectively and tidy.
The Sass is compiled using libsass, which requires the GCC to be installed on your machine. Windows users can install it through MinGW, and Mac users can install it through the Xcode Command-line Tools.
$ cd my-wordpress-folder/wp-content/themes/
$ git clone https://[email protected]/jamzth/foundationtheme.git
$ cd foundationtheme
$ npm install$ npm run watchIf you want to take advantage of browser-sync (automatic browser refresh when a file is saved), simply open your Gulpfile.js and put your local dev-server address (e.g localhost) in this field var URL = ''; , save the Gulpfile and run
$ npm run watch$ npm run buildBuild all assets minified and without sourcemaps:
$ npm run production$ npm run packageRunning this command will build and minify the theme's assets and place a .zip archive of the theme in the packaged directory. This excludes the developer files/directories from your theme like node_modules, assets/components, etc. to keep the theme lightweight for transferring the theme to a staging or production server.
-
style.css: Do not worry about this file. (For some reason) it's required by WordPress. All styling are handled in the Sass files described below -
assets/scss/foundation.scss: Make imports for all your styles here -
assets/scss/global/*.scss: Global settings -
assets/scss/components/*.scss: Buttons etc. -
assets/scss/modules/*.scss: Topbar, footer etc. -
assets/scss/templates/*.scss: Page template spesific styling
Please note that you must run npm run build or npm run watch in your terminal for the styles to be copied and concatenated. See the Gulpfile.js for details
assets/javascript/custom: This is the folder where you put all your custom scripts. Every .js file you put in this directory will be minified and concatenated one single .js file. (This is good for site speed and performance)
Please note that you must run npm run build or npm run watch in your terminal for the scripts to be copied and concatenated. See Gulpfile.js for details
Version control on these files are turned off because they are automatically generated as part of the build process.
-
assets/stylesheets/foundation.css: All Sass files are minified and compiled to this file -
assets/stylesheets/foundation.css.map: CSS source maps -
assets/javascript/vendor: Vendor scripts are copied fromassets/components/to this directory. We use this path for enqueueing the vendor scripts in WordPress.
Foundation comes with everything you need to run tests that will check your theme for WordPress Coding Standards. To enable this feature you'll need to install PHP Codesniffer, along with the WordPress Coding Standards set of "Sniffs". You'll need to have Composer To install both run the following:
$ composer create-project wp-coding-standards/wpcs:dev-master --no-devWhen prompted to remove existing VCS, answer Yes by typing Y.
Once you have installed the packages, you can check your entire theme by running:
$ npm run phpcsIf there are errors that Code Sniffer can fix automatically, run the following command to fix them:
$ npm run phpcbfFoundation Theme is completely ready to be deployed to and tested by Travis-CI for WordPress Coding Standards and best practices. All you need to do to activate the test is sign up and follow the instructions to point Travis-CI towards your repo. Just don't forget to update the status badge to point to your repositories unit test. Travis-CI