Creating a Custom Wordpress Theme

Creating a Custom WordPress Theme from the Ground Up

If you have been wanting to own a personal blog that would serve as an outlet for your poetic thought/political opinions/movie reviews, there are a whole lot of options available for you to begin with. However, when being known as a serious publisher is on your agenda, WordPress happens to be the de facto most recommended content management system.

But, what if you don’t want it to leave it to an unfamiliar WordPress theme to give your website the layout and the overall look and feel you have been striving for. Do you have options? Plenty!

One of the most amazing attributes to WordPress is that it lets you create custom themes that might involve a lot of setup, but the end result is gratifying (if done correctly).

To begin with, you need to have a hands on experience on implementing CSS and HTML and if you know your way around them, the job should become all the more feasible for you to carry out.

Creating a Custom WordPress Theme :

You will need cPanel to to access or create the theme files of your new WordPress theme. Now, before you start digging your heels deep in the process, it is important to get a clear eyed idea about the files that you will be working on while creating your custom WP theme:

  • header.php: As the name suggests, the content or design that appears on the header of the site will be coded into this file.
  • Index.php: This constitutes the main body of your theme and usually contains code for the homepage of your website
  • footer.php: This file contains code for everything that appears at the footer.
  • Sidebar.php: This one contains code for the elements displayed on the sidebar of the theme
  • style.css: This file dictates the styling of your theme

Apart from the afore mentioned, the other files that form the core of your theme include:

  • archive.php
  • single.php
  • comments.php
  • page.php
  • search.php
  • 404.php
  • style.css
  • functions.php

These files contain the PHP template tags and these can be created by a tool as simple as notepad and they can be uploaded a File Manager available in the cPanel.

Building the Underlying HTML Code

The design and functionality of your website will be dictated by the HTML and CSS. The HTML code of your website should look something like this:

Populating the PHP files of the Theme

Each of the PHP files we touched upon above has to contain the appropriate code for them to help you create your theme effectively:

Header.php file

This file in detail describes the functions each line should facilitate. The could to load the CSS file is elaborative enough.

Index.php

The standard WordPress functions are coded in this file and there are some internal functions that are defined here. The code also checks if there are any posts in your WordPress site, and if there are, they are displayed duly:

The main area text placed in the code determines which part of the theme is displayed in the specific area.

Sidebar.php

Now, all the categories and archives that have to displayed on the sidebar are defined in the sidebar.php file

Footer.php

Add the following lines of code to your footer.php file and your theme’s footer will have a firm ground:

While this code adds the footer lable, but if you wish to add certain URLs, you can do so seamlessly.

Now comes the style.css file

The style.css file defines the styling of your web pages. Now, add the following code to the file to get a more structured control

You have thus created a WordPress them,e that suits your sensibilities and design specifications till the very last thread. Be careful while adding the codes to leave no room for bugs.

Author Biography:

Samuel Dawson is a collective and inspired web developer in Designs2html Ltd which is a nice firm in the process of converting HTML website to WordPress theme with responsive design. The above article is on making a WP theme in simple steps represented by Samuel Dawson.

Creating a Custom WordPress Theme from the Ground Up
5 (100%) 1 vote

About Author

jemee

"I'm a technical writer in Jewel Theme. SEO and Marketing always liked by me and I love these two things very much in my life. As writing is my hobby, I love Blogging too much."

Share this

Sharing is Awesome, Do It!

Share this post with your friends
close-link