Welcome to WordPress Themes

Reading Time: 4 minutes

As we move down the WordPress Dashboard we’ll come to the Appearance tab. Which starts us off in Themes.

The theme is the face of your WordPress install. When you start up a fresh WordPress install you’ll be greeted with one of the twenty{something} themes. As of this writing that would be twentyseventeen. You’ll also have a few other twenty{year} options under the Themes menu, but what exactly is a theme.

What is a Theme

The WordPress theme is the face of you site. It’s the combination of PHP, CSS, and JavaScript files that works together to make your WordPress site come to life.

WordPress twentyseventeen Theme

Your WordPress theme could consist of only an index.php and style.css file. With style.css file declaring your theme name and index.php containing your WordPress loop. Your site is going to be pretty lame, but it could be done.

A theme could also be as complex as having several different PHP files that combine to form a single PHP template for a post.

A typical theme is likely going to have at least the following files:

index.php – The main loop for displaying posts on the site.

single.php – The main layout for a single post of type Post.

page.php – The main layout for a single post of type Page.

style.css – The styles and theme name declaration.

functions.php – This file is options, but can be used for adding functionality to WordPress sites. More on this shortly.

Template Hierarchy

How WordPress determines which files from the theme to use to display certain post is known as the template hierarchy. This is a set of rules WordPress uses to determine which PHP files to look for first when outputting a post.

It can get pretty complex. For now we just want to understand the concept of the template hierarchy instead of delving to deeply into which templates follows which. If you’d like to dig into it yourself check out the Codex. For now just know that everything falls back to index.php.

Functions.php

Most themes you will come across will make use a functions.php file. This file acts like similarly to a plugin, but can be used to add features and functionality specific to a theme.  The functions.php file is good for adding Javascript libraries for certain theme functionality via the wp_enqueue_scripts action. Or adding theme support for things like custom logos or the new-fangled video header functionality1.

I’ll use this point now to tell you that you shouldn’t put Custom Post Types or Custom Taxonomies in the the functions.php, or anywhere else in the theme files for that matter. Unless it really is specific to that particular theme.

Why? Because if you switch themes, suddenly that Post Type isn’t registered anymore and you lose all that data from the WordPress dashboard. It would still be in the database, but you wouldn’t have a way to edit it in the backend as WordPress wouldn’t recognize it as a Post Type anymore.

Of course there are two sides to every matter. WP Beginner does a good job laying out the differences between registering Post Types in your theme vs. a plugin.

Child Themes

Child themes are themes that pull in the styles and functionality from another parent theme allowing you to modify the parent without editing files in the parent theme directly.

This is extremely useful if you’re making modifications to a theme that receives updates from the theme developer. If you were to edit files directly in the parent theme directory, anytime you would update the parent theme you would lose all of your changes.

A child theme allows you to create a separate file directory with a style.css declaring the child theme name and parent theme template, and a functions.php used for enqueueing the styles from the parent theme.

You can then duplicate a file such as single.php from the parent theme directory and edit it to your hearts content in the child theme directory. WordPress is smart enough to know to find the template file in the child theme first.

If down the road the theme developer issues an update that improves the single post display, you could delete your child theme’s single.php and it would revert to using the parent theme’s file.

Neat!

Where to Get Themes

The “twenty” themes are those that come with the Core WordPress software, but there are a few other flavors of themes: free and premium.

Free Themes

WordPress.org has a wide variety of free themes to choose from. They can range from pretty great to pretty not great. But the theme repository does have standards a theme has to meet to be included, so for the most part all of these themes should get the job done. These won’t have a lot of features though. For that you’ll want to check to Premium Themes.

WordPress Org Themes

Premium Themes

WordPress is great because anyone with an internet connection and some know how can create a custom theme. That means there are tons of WordPress themes available on the web for purchase at various prices.

Themeforest and other marketplaces have driven a culture of including every bell and whistle in a theme for next to nothing costs. Which causes developers to focus on adding more features than the quality of features in a lot of these themes. I find themes tend to work much better when developed for a specific purpose. The common user probably ends up using a small percentage of the features in these do-it-all themes.

Not to say there aren’t some great themes on Themeforest. There is just a lot of noise to sort through to find a quality bug-free theme. If such theme as a bug-free theme exists.

One of my favorite theme developers is Array Themes. You can really tell the thought and time that goes into developing each of their themes to fit specific segments of the theme marketplace.

I’ve also developed a theme for podcasting and blogging named The Pine. I use it for my personal site2, and another sports blog I help run for fun on the side.

  1. As of WordPress 4.7.
  2. As of writing in December 2016

Pin It on Pinterest