Coder Social home page Coder Social logo

benbrehaut / wp-vanlig Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 1.0 578 KB

Blank WordPress starter theme made for being customisable.

PHP 67.65% JavaScript 2.51% CSS 29.84%
theme starter-theme wordpress sass browsersync blank-wordpress-theme wordpress-theme wordpress-development wordpress-starter-theme php

wp-vanlig's Introduction

Vanlig

Introduction

A starter theme for WordPress to create your next amazing site!

The purpose of these theme is to be a starting point for theme creation, reducing the time of removing parts of removing parts of other themes which are not needed, and adding our own. Simpley put, it should allow you as a developer to dive deep into your project!

Requirements

How to build

  1. Clone this repo and place within your '/wp-content/themes/' folder.
$ cd /wp-project-folder/wp-content/themes/
$ git clone github.com/benbrehaut/vanlig.git
$ cd vanlig
  1. While within the theme root, run;
npm install
  1. Open the gulpfile.js file and change the proxy name in BrowserSync for your site URL.

  2. Then run the npm command to start development!

npm run dev

This will open up a new BrowserSync session and start watching our files for changes and compiling and uglifying the JavaScript files.

Tasks

BrowserSync

Default task

BrowserSync is a useful tool for having your changes made when coding reload your tab automatically. On start of Gulp, BrowserSync will start a new session and provide you a local address (localhost:3000) and a external address (192.168.##.##:3000) which you can use to view your site on another device which isn't your computer.

BrowserSync watches for changes made to all .php, .css and .js files, so any changes will be applied automatically.

Make sure you have changed the proxy name in the BrowserSync settings in the gulpfile.js for BrowserSync to work.

Styles

Default task

All Sass files are located within /assets/scss, with the style.scss outputting into /assets/css/dist/main.css This can be changed with gulpfile.js file if you wish, but is probably best to keep it to this default location.

  • style.css within the root of this theme is blank on purpose, and is required by WordPress to register this as a theme.
  • /assets/scss/style.scss is our main stylesheet, which will compile everything inside it into /assets/css/dist/main.css and also the minified and compressed version, /assets/css/dist/main.min.css

Scripts

Default task

All JavaScript files are located with /assets/js, the scripts.js file is the main Javascript file for the theme, with external third party libraries within the vendor folder. All files within this will be concatenated into the dist/main.js file and dist/main.min.js

The scripts task will also run the main JavaScript file through Babel, which means you can use all the new ES2015, ES2016 etc. features without fear of them not working in some older browsers!

  • /assets/js/scripts.js is the main JavaScript file. This is where you should write all of your JavaScript.
  • /assets/js/dist/main.js is the uncompressed and concatenated JavaScript file from all of the files within the /assets/js/vendor/*.js folder and /assets/js/scripts.js file.
  • /assets/js/dist/main.min.js is our compressed version of the /assets/js/dist/main.js file.

SVG Icons

Non default task

Instead of putting the full SVG code, we can reference them using <use xlink:href="#icon-name"></use>

Place all of the icons within the /assets/icons/ folder, and then run the command gulp svgstore which will then generate the svg-defs.svg file. This is linked at the bottom of the footer.php file.

You can then use the icons with the <use></use> tag!

<svg class="icon">
  <use xlink:href="#icon-name-of-icon-file"></use>
</svg>

Image Minification

Non default task

If you require images within the theme, you can minify the images without the lose of quality.

Run the command gulp imgs which will minify all .jpg's, .png's and .gif's. The files will be replaced automatically with the new minified version.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.