Sunday, June 28, 2015

Bootstrapping a Theme

This series of posts explores the basics of creating WordPress themes for one's use; as opposed to creating one for redistribution.  The distinction is important as we will only focus on developing it for a particular use and thus greatly simplify the effort.

This particular use will to have:
  • Static Home Page
  • Hierarchy of Sub Pages
  • Search
  • Press Releases
  • Mega Menu
  • Breadcrumbs
This effort also is focused on giving one maximal control over the site (HTML, CSS, and JavaScript) with minimal use of programming (WordPress and PHP).

The starting point to understanding theme development is the template hierarchy: https://developer.wordpress.org/themes/basics/template-hierarchy/.  Rather than building out a bunch of template files to start with; we will start slowly and introduce them one at a time.

Bootstrapping a Theme

Create a new folder for your theme, e.g., barebones, in the WordPress folder: wp-content/themes.

Populate this new folder with two files:

index.php
<html>
  <head>
    <title>Barebones</title>
  </head>
  <body>
    <p>Hello Barebones</p>
  </body>
</html>
An empty style.css file.

At this point we have a theme that we can activate.  This theme, however, is not terrible useful at all that it does is display the text Hello Barebones regardless of the query string.

No comments:

Post a Comment