Jake Intel

Jake Group

WordPress Building Blocks: Themes and Templates

The world of web design includes an entire library of technical terms and industry jargon, which sometimes causes confusion. WordPress too, our Content Management System (CMS) of choice, adopts certain lingo that can puzzle even the most web-savvy clients. One of the most common points of confusion we encounter involves the difference between the terms ‘Theme’ and ‘Template.’

Themes Make Websites

You may be aware from previous experience that the WordPress platform consists of three main parts:

  1. The Core, which provides the underlying infrastructure for a website and CMS;
  2. Plugins, which extend and alter the functionality of the core; and
  3. Themes, which control what web pages look like when rendered in a browser.

While the Core and Plugins address the heart of the framework, Themes are vital because without them, you wouldn’t be able to see anything on the website! In other words, a theme represents the highest level descriptor for the set of web files that shapes how a site behaves and displays content.

Whether custom built or downloaded from an theme library, a theme is made up of a collection of files that governs the output of the website, commonly including HTML, CSS, JavaScript, and PHP file types. While these are all part of what constitutes a theme, it’s the last one, the PHP files that typically represent what a template refers to in WordPress.

Templates Make Webpages

As mentioned before, themes affect how a page will look, and the theme will accomplish this by employing template files. While it’s possible that a given page rendering is controlled by a single PHP file, it more common to find multiple PHP files used to build a page, each with its own specialized function.

In a typical blog post like this, three theme files might be used: header.php, index.php, and footer.php. The header controls the way the area above the post is laid out often including a logo and primary navigation items; the index file affects the body of the post, including the title and text and graphical content; and the footer provides for what is shown below the post itself.

In this way, the template-driven approach provides consistent styling across multiple posts, thereby making a site not only look more professional, but also be easier to maintain. Of course, these three template files are just the beginning. For example, many sites will have a sidebar, which is rendered by sidebar.php. In many themes, a more specific template file, single.php, will render the blog post, while another, page.php, will be used for displaying other pages on a site.

Hopefully this description helps begin to explain the important distinction between themes and templates when discussed in the context of a WordPress website development project. If you’re ready to embrace the power of WordPress themes and templates, reach out to us today, and we’ll be happy help!