After popular demand (or just demand) I have decided to write this tutorial on creating a WordPress theme.
Some things about this tutorial:
- It will not teach you everything. It will teach you how to make a basic WordPress theme that works. I can say that even I refer to the Codex every now and then to find out how to do something.
- It will not teach you HTML or CSS so I will assume that you have some idea of that already.
- It doesn’t teach you how to simply ‘convert’ an HTML layout into WordPress; it does go through a few basic things so you will need to skip over that with your own head if you’re already familiar.
- The Codex is where you need to go for “extra stuff” that is not in this tutorial. You should go there for specific tags and codes that you may want or need.
- Again I will state that you will learn how to create a basic WordPress theme. No bells and whistles, just a theme that functions. This means that you will have to refer to my Search Results tutorial if you want to make a search bar and search results; my Widgetizing Sidebar tutorial to widgetise your sidebar.
The files you will need
style.css — the ultimate flesh of your website, but you don’t need to be too concerned about this right now to be able to make a WordPress theme work. It’s just for the fancy stuff.
index.php — the homepage. Self explanatory; pretty much the body of your homepage.
header.php — the head of all your pages. Usually contains metadata and other fun stuff.
sidebar.php — the sidebar of all your pages. You may or may not have/need one, but for this tutorial, you will.
footer.php — the feet of all your pages, so to speak.
single.php — a version of index.php especially for single posts/entries.
page.php — a version of index.php especially for single pages created in WordPress.
comments.php — the file that displays the comments and the comments form.
I could have made this tutorial extremely basic and only included index.php
and style.css
but that would be far too easy and we all like a little challenge, don’t we?
Other things you will need
- WordPress installed. Sorry, but it’s got to happen.
If you’re lucky you will have Softaculous or Fantastico to automatically install it for you. I recommend installing in another folder, you can call it wordpress
or wp
.
- A text editor like Notepad (this is the one I like to use).
- An FTP client. I use LeechFTP, but any old one will do. You can also use your File Manager in cPanel, but it’s easier to use FTP since it’s just drag-and-drop.
- Patience. This will take time, so don’t expect to create a theme in ten minutes if you’re new to this.