Understanding WordPress Theme: The Basics of Creating Your Own WP Theme

There are a variety of free and premium WordPress themes that you can find throughout the web. You will sometime find that you can spend hours trying to modify the theme, so it is tailored to the way you want it. Sometimes it’s easier to create your own from scratch, and not deal with the headaches that can happen with customization of an existing WordPress theme. This guide will help you to understand the basic of a WordPress theme and how to create a simple theme.

I recommend that before you begin, you familiarize yourself with the WordPress file structure by analyzing as many WordPress themes as you can (NoteYou need to have a basic understanding of HTML and CSS.)

Getting Started

Begin you begin coding up the theme, you must understand that the WP theme is just like any other HTML webpage, except that it is coded with PHP. Even so, you don’t need to be a PHP expert to do up a WP theme. My advice is:

  1. First get a working pure HTML page up and running (You can easily do this with a WYSIWYG webpage editor).
  2. Open the HTML webpage in a text editor and slice it up to different portion (we’ll explain more on that later)
  3. Insert in the PHP code

WordPress File Structure

The basic file structure of a WordPress theme is as follows:

  1. Style.css – The stylesheet holds all the formatting and styles of the theme
  2. Index.php – This is the main WordPress theme file that ties all the other files together
  3. Header.php – Holds all the header information. Also, if all the files were lumped together, this would be the beginning of the WordPress theme
  4. Sidebar.php – It has all the code for the sidebar
  5. Footer.php – Holds the footer code

Other files that you will also find in a WordPress theme are:

  1. Single.php – A single blog post code
  2. Comments.php – This is where you place the code to control the behavior of the blog comments
  3. Page.php – Controls the behavior of your individual pages
  4. Search.php – This is if you want to add search capability to your WordPress theme
  5. Searchform.php – Controls the way the search box behaves
  6. 404.php – Customize the landing page if your readers get an 404 error
  7. Functions.php – A way to further customize your WordPress theme
  8. Archives php – How to display the archive results

A simple layout of the theme


[Read More: Full article by Shevonne]

Etc.. |