If you have been using already developed themes on your WordPress blog and wondering how those themes are made then you will get all your answers in this post. I will teach you about making your own WordPress theme but of course, only a basic one. Since, this is going to be your first time making a WordPress theme; we will keep it as simple as possible.learn-to-make-wordpress-themes-588x271

Don’t Miss : How to make Child theme of genesis?  & How to make HTML pages ?

Before making any WordPress theme, you need to know about different parts or sections of the theme that have to be designed and developed individually.

The major parts of any WordPress theme are;

  • Header
  • Body
  • Sidebar
  • Footer

wordpress-theme-1The very first thing that you will need to do is to make following files in the directory where you will be saving all the information your WordPress theme.

  • header.php
  • index.php
  • sidebar.php
  • footer.php
  • style.css

To make and edit the files, you can either use a simple text editor or any HTML editor program.

header.php

In header.php file, we will add the following standard code.

wp theme

After title, there is <link rel=”stylesheet” href=”<?php bloginfo(‘stylesheet_url’); ?>”>, which informs WordPress to open style.css file. The <?php bloginfo(‘stylesheet_url’); ?>  is a function which loads the stylesheet file.

After which, a “div” is added with the help of a class wrapper which acts as the main website container.

index.php

wp theme

As you can see, we are beginning the code with <?php get_header(); ?> that has got the header.php file and code is also inserted in the main page. We use an internal WP function to get this work done. This is the same section where we will specify a location for the body text.

In order to separate main area and side bar from each other, we have added an empty division in the code.

sidebar.php

We will add the following standard code in sidebar.php;

wp theme

Again, we have used an internal WP function so categories and archives can be displayed in this file. WordPress returns these as list items which mean that we will have to use another function for adding <ul> tags.

footer.php

Add these lines to the footer.php file:

wp theme

The code is very simple to understand. All we are doing here is to add a footer label on the page. If you want, you can add some custom links and other information in footer area as well.

The style.css file

Following lines are added to the style.css file:

wp theme

The simple.css file is what defines the look of your theme. The lines that are written above are responsible for making a background on your theme and also many other main parts that are included in the theme.

So, above was a very simple and easy tutorial for anyone to create a new WordPress theme easily and if you are not able to make it properly then do not mess with it and try any good web design company for theme developing. You will not be able to make an impressive and great looking theme with the help of codes provided above but if you will follow all the steps properly, you will definitely learn a lot of things about making a WordPress theme. You can use that knowledge to design a perfect and dynamic WP theme one day. If you have any other notice for us then do let me know in commenting below. Thank you.

Saif Ullah is an SEO & Internet Marketing expert working as a social media marketing manager. He loves to play with gadgets and Google. He has been running Saif Ullah Butt for sharing his personal adventures in Internet life. You can catch him on Facebook. Do you want some guidelines in SEO ? Get Quote Now for SEO !

Facebook Twitter LinkedIn Google+ YouTube