Advertisement
  1. Code
  2. WordPress
  3. Theme Development

Making a Theme With Bones: Getting Started

Scroll to top

We are using a starter theme to build a new responsive site.


Why Bones?

Built with HTML5, image by W3C, https://www.w3.org/html/logo/Built with HTML5, image by W3C, https://www.w3.org/html/logo/Built with HTML5, image by W3C, https://www.w3.org/html/logo/

Bones is a completely free starter theme (not a framework) built with the latest best practices. It serves as an excellent base to build a WordPress theme. This is an incomplete feature list about Bones:

  • built upon the HTML5 boilerplate
  • mobile first approach
  • responsive design
  • comes with LESS and SASS
  • fallback for older browsers
  • cleaner header section
  • great documentation

Step 1: Download Bones

You can download the starter theme from the Themble site.


Step 2: Themes Directory

Unpack the ZIP file into wp-content/themes and rename its directory to bones.


Step 3: Theme Settings

Setting Bones to use as actual themeSetting Bones to use as actual themeSetting Bones to use as actual theme

Set the theme in the WP admin interface to Bones (at Appearance / Themes).


Step 4: The Page

This is how the website looks with the basic Bones theme. The resolution is 1440x900 pixels.

The WordPress page with Bones turned onThe WordPress page with Bones turned onThe WordPress page with Bones turned on

Step 5: Theme Basic Data

This is the place of theme name, description, author, version and so on. The style.css file is in the theme directory. Basically the themes based on Bones don't use any real styles here, but just the data for showing the info in the admin interface.

1
2
/************************************************************************
3
Theme Name: Kotkoda
4
Theme URI: https://code.tutsplus.com
5
Description: This site was built using the Bones Development Theme.
6
Author: Adam Burucs
7
Author URI: http://burucs.com
8
Version: 1.0
9
Tags: flexble-width, translation-ready, microformats, rtl-language-support
10
11
License: GPL2
12
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Step 6: Download a LESS or Sass Compiler

This tool is needed to compile and minify the styles of Bones into a production CSS file. I chose WinLESS because I'm working on Windows 7.

WinLESS windowWinLESS windowWinLESS window

Step 7: Exploring the Bones (LESS) Styles

In the bones/library/less directory you can find all files to customize the theme. These are the styles we need:

  • 1030up.less - desktop stylesheet
  • 1240up.less - mega sized monitor stylesheet
  • 2x.less - styles for Retina screens
  • 481up.less - 481px+ styles
  • 768up.less - tablet and small desktop stylesheet
  • base.less - the base for mobile devices
  • ie.less - here we call all styles for IE, but without the media queries
  • login.less - we can modify the login page of WordPress
  • mixins.less - this is where we use LESS mixins and constants
  • normalize.less - general reset for default styles
  • style.less - main styles, uses all other files

Step 8: Main Background and Text Color

We are using orange background and mid-grey (@kotkoda-grey) text color in base.less. (Use color to set the font's color and the background property to set the background color.)

1
2
body {
3
	font-family: Georgia, serif;
4
	font-size: 14px;
5
	line-height: 1.5;
6
	color: @kotkoda-grey;
7
	background: #ED7626; /* main background color */
8
}

And this goes into mixins.less. You can define a color variable in LESS with the following: @kotkoda-grey is the color variable name and after the colon is the color code (#19171A). Every variable name starts with the @ sign.

1
2
@kotkoda-grey:		#19171A;

Step 9: Link, Heading and Post Meta Color

For links the color will be @white, but @alert-yellow will be used for hover and focus styles. Use the color property to set the value. Every heading and heading with links will be @kotkoda-grey. We need a bit darker grey for this, the original value was #999. With the color rule we can set it to #444 (which is equal to #444444).

1
2
/*********************

3
LINK STYLES

4
*********************/
5
6
a, a:visited {
7
	color: @white;
8
9
	/* on hover */
10
	&:hover, &:focus {
11
		color: @alert-yellow;
12
	}
13
	...
14
}
15
16
...
17
18
h1, .h1, h2, .h2, h3, .h3, h4, .h4, h5, .h5 {
19
	font-family: sans-serif;
20
	text-rendering: optimizelegibility;
21
	font-weight: 500;
22
23
	/*

24
	if you're going to use webfonts, be sure to check your weights

25
	http://css-tricks.com/watch-your-font-weight/

26
	*/
27
28
	/* removing text decoration from all headline links */
29
	a {
30
		text-decoration: none;
31
		color: @kotkoda-grey;
32
	}
33
}
34
35
...
36
37
/* post meta */
38
		.meta {
39
			color: #444;
40
			...
41
		}

Step 10: Our Page After These Modifications

This is how it looks in 600 pixels wide.

This is how the page looks after some modificationsThis is how the page looks after some modificationsThis is how the page looks after some modifications

Halfway There

We come to the end of the first part of this tutorial series.

Advertisement
Did you find this post useful?
Want a weekly email summary?
Subscribe below and we’ll send you a weekly email summary of all new Code tutorials. Never miss out on learning about the next big thing.
Advertisement
Looking for something to help kick start your next project?
Envato Market has a range of items for sale to help get you started.