Is facebook killing modern romance?
Is facebook killing modern romance?
Rather than ‘proceed with caution’
Instead – ‘proceed with alacrity’
Before getting into the nitty gritty of applying CSS it’s worth taking some time to understand the HTML structure of the page in _s.
Conceptually I always think of an HTML page as a series of boxes each nested inside one another – each having a unique name with different types of boxes sharing characteristics.
In HTML terms there are three important ways of identifying and categorising these boxes:-
So for _s and most WP themes
Or to more easily visualise it https://themeshaper.files.wordpress.com/2012/10/html-visual1.png
So as discussed previously I’ve decided to build a new WordPress theme and instead of pulling the normal trick of simply creating a child theme I thought I’d take the plunge and develop my own from (almost) scratch using ‘_s’. To recap underscores (_s) is a popular starter theme maintained by Automattic (yeah the WordPress.com people) which keeps itself upto date with all the HTML5 standards and best practice.
This first article simply peers under the hood and looks at what you get with the zip file from underscores.me
Unsurprisingly _s keeps itself in line with the WordPress template hierarchy and naming conventions and a quick run through the list of files that form _s will see a number of familiar names.
There are other files included but the above form the core of the theme in terms of crafting the layout.
_s does make use of a modular approach with a corresponding hierarchy which defines which templates get included.
There are a few diagrams available to summarise this hierarchy and show what gets included, two of the better ones being:-
The other key file to note is functions.php which unsurprisingly contain functions for the theme. Broadly this file proivides:-
The style.css file contains all the key style info for the template. IT’s well organised and structured into 12 sections:-
This both makes it easy to follow and make updates as well as helping if SASS is the end goal.
The other great thing about _s is that it’s fully and clearly commented through out the various files which makes understanding where things go and how they relate a lot more straightforward.
Anyway there we have the key bits of the theme..next article, some key plugins for development.
So part of rekindling of my blogging love is the firm commitment to learn how to create my own themes.
Partly this is due to the frustration at the current crop of themes not quite nailing it, and seemingly growing number that seem to charge for anything above the basics. This of course is a sweeping generalisation that has little basis in any fact other than my irritation that I can’t do out of the box the cool things I want. Also wedded to this frustration is a deep down belief that I probably could do better – the hubris flight leaves soon.
Where to start…
Well a quick tour around google turned up a number of starter themes each based on a variety of different frameworks and approaches. The flexibility of WP as a platform leads to a bewildering number of options to achieve the desired end result. So based on three main factors I picked Underscores (_S), the three factors being:-
Having picked a suitably unoriginal theme name I filled out the details on Underscores.me and downloaded my nice new theme.
Yep it looked like it was designed in the 80’s – which if I had engaged my brain wouldn’t of been such a shock.
But this led to a little complication. Although I wanted to learn the zen of theme building I didn’t want my site to look like amateur hour while I crafted my skills.
Luckily there were, again, lots of options on the font of all modern wisdom (google)… the one I picked was installing a nifty little plugin called ‘Theme Test Drive‘.
This enables you to run a separate theme as administrator while the general public see a different one. This gave me the flexibility to craft out a new them behind the scenes – learning my craft as I go, while keeping the external view of the site untouched. Also it had a very cool option of allowing a url option to point to the admin theme – allowing a sneak peak.
Anyway its a start and as develop the new theme I’ll be posting here to track what I’ve done, and how it’s worked out.