Basic files needed to create a Wordpress Theme.

CATEGORY : Blog | Wordpress Files | Wordpress Tutorial |

I am assuming that you have downloaded your own WordPress latest theme. If not yet you can download HERE.

Now to start off, We need to find out whats involved in making a WordPress theme. WordPress themes are made up of PHP pages and CSS file. So what are standard pages you need to create a to build a basic WordPress themes? Below are the following files :

  • 404.php
  • index.php
  • header.php
  • footer.php
  • single.php
  • search.php
  • page.php
  • functions.php
  • style.css
  • screenshot.png


404 Page

A 404 error is when the server could not find the page that was requested by the client. This can be because of the link to the page has been changed by the admin, deleted by the admin, wrong search by the user or the link don’t really exist at all.


The index file is going to be by default the first page which will be called from the WordPress framework. In layman’s terms, once you go to a certain site “www.website.com”, the very first layout that is holding it is called Index. The code normally looks like this.

<?php get_header(); ?>

header.php & footer.php

header.php & footer.php is generally created in order to make your work faster and don’t copy paste your codes to every pages. On the given code below, <html> until <body> are repeated on every sinple page that you will be loading. To make the life of developers much easier this are created.

<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US">
  <head profile="http://www.w3.org/2005/10/profile">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon" />
    <title>Morning Codes</title>
    <link rel="stylesheet" type="text/css" media="all" href="style.css" />


The single page is the template to be used on single posts  this is where the contents of your post  will be displayed and also where the user would have the chance to create their comments.


Search page is where all the related searches that the user search on your search bar would be displayed.


This is where the contents of your pages would be displayed. Note : single.php is different from this since single.php are displaying content coming from your Post area while page is from Page area.










The functions.php page is a page where you can put any custom functions which can be called by any of the other pages in the wordpress blog. You can put anything you want in here and apply hooks to make sure these functions run at the right moment.


The style.css is the file where you will put the default styles for your blog. The right way of creating your css file on WordPress would be the code below.

 Theme Name: Morning Codes
 Theme URI: http://www.morningcodes.com/
 Description: Old school theme for WordPress by morningcodes.com
Author: Romeo Pasion
 Version: 5.0
 Tags: old school, minimalistic, simple, elegant


screenshot.png is needed so when you activate your theme you can automatically preview the theme that you will activate on the admin panel of WordPress.

Some might think i did forgot to include comments.php but actually i did not include it on purpose. Why? Generally speaking WordPress has his own default  comments.php and you can call it by using the code below

comments_template( '', true );

4 Responses to “Basic files needed to create a WordPress Theme.”

  1. Dori Hendron says:


    Thanks for the article ….

  2. edu says:

    I found you’re blog via Yahoo and I have to say. A Huge Thank you so much, I thought that your post was extremely enlightening I’ll revisit to see what more great information I can recieve here.

  3. firma sprzatajaca Bydgoszcz says:

    Hi! I know this is somewhat off topic but I was wondering if you knew where I could locate a captcha plugin for my comment form? I’m using the same blog platform as yours and I’m having difficulty finding one? Thanks a lot!

Leave a Reply

Old School

Hi! Romeo is Web Developer for 7 years now.Currently i focused more on CMS based projects most of the time Wordpress and its different premium templates like Genesis and Thesis.

I love travelling during Saturdays and Sundays when got no works to removed stress when mondays come to start working again.

Upcomming Contents

  • Creating wordpress widget
  • Creating wordpress plugin
  • Jquery and Wordpress
Footer Logo
2008-2011 Morning Codes. All rights Reserved