Basic Concepts of WordPress Theme Development

Basic Concepts of WP Theme Development Want to develop a WordPress Theme but don’t know where to start ?

Then you should keep on reading this article.

In this article, I will explain the most basic subjects of WordPress theme development one bite at a time in plain English.

# 1 :

A wordpress theme is not a single file.

It is made of many files.

These files all act together to form the appearance and functionality of a particular WordPress theme.

# 2 :

WordPress theme files are placed inside of subdirectories under wordpress themes directory (wp-content/themes/…)

For example, if you have a theme named “mynewwptheme” you should place it to wp-content/themes/mynewwptheme/

# 3 :

Don’t use numbers when you name your new wordpress theme !

If you use numbers, your theme may not appear on theme lists.

# 4 :

When you install wordpress, it always comes with a default theme.

# 5 :

A usual wordpress theme has three main types of files; style.css, index.php, functions.php

# 6 :

The leanest wordpress theme may come with only two files; style.css and index.php (of course this is in theory. In almost all cases, you will see more than these two files)

# 7 :

style.css is responsible from the appearance of a wordpress website.

It keeps Cascading Style Sheet (CSS) codes.

# 8 :

index.php is a wordpress “template file”

It is a file coded in PHP.

Index.php gets the data from your database and presents it as HTML to your visitors.

# 9 :

In theory, you may have just one template file (index.php)

But, normally you should divide index.php into functional sub-files.

# 10 :

There are 19 theme template files recognized by WordPress.

The most significant ones are;

  • comments.php
  • footer.php
  • header.php
  • sidebar.php

# 11 :

functions.php is optional.

Basically, you may think about it as a plugin.

It holds some functions.

If it is inside of your theme, it loads automatically during the initialization.

# 12 :

The comment lines at the head of style.css are required.

These comments enable WordPress to identify the theme.

# 13 :

It is not allowed themes to have the same header.

So, if you are developing a theme based on an existing one, then you should change these comments lines.

# 14 :

The author name can be either author’s username or his / her real name.

It is up to the author’s wish.

I hope this very basic introduction to theme development is helpful for you.

If you wish, you may also read my article about “Components WordPress Starter Theme“.

Tolga Ayan

Writes articles about WordPress, CSS & Related Web Technologies. Resident of Alpharetta, GA.

We'll be glad to hear your comments !