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.
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;
To make and edit the files, you can either use a simple text editor or any HTML editor program.
In header.php file, we will add the following standard code.
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.
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.
We will add the following standard code in sidebar.php;
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.
Add these lines to the footer.php file:
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:
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.