Basic files needed to create a Wordpress Theme.
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 :
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(); ?> CONTENTS <?php sidebar(); get_footer(); ?>
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" /> </head> <body>
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.”
Leave a Reply
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.