Create a custom WordPress theme: Step 5

There are many different WordPress themes available, but sometimes you just cannot find the one that will fit your needs. When that happens, it is time to create your very own custom theme. I will show you in a series of six steps how to do just that.

In step 1 we learned how the themes work, a first step in creating your own custom theme for WordPress.

In step 2 we learned to create the template files.

Step 3 taught us about the header file and step 4, the footer.  Now, let’s consider the sidebar.

Step 5.

The side bar is located on the side of your website page, you can choose to have it on either right or left side. Most commonly people choose the left, but you should put it where you are most comfortable. To create the sidebar file:

The Sidebar File: name it sidebar.php

<div id="sidebar">

<h2 class="sidebartitle"><?php _e('Categories'); ?></h2>

<ul>

<?php wp_list_cats('sort_column=name&optioncount=1&hierarchical=0'); ?>

</ul>

<h2 class="sidebartitle"><?php _e('Archives'); ?></h2>

<ul class="list-archives">

<?php wp_get_archives('type=monthly'); ?>

</ul>

</div>

The sidebar will contain the categories , archives, text widgets and other sidebar attributes.

So, you’re almost there in creating your own custom theme for WordPress! You should now have an understanding of how custom themes work and the technical knowledge on how to create your files.  Stay tuned for step 6, the final lesson.

Posted on April 3, 2015 and filed under Custom Wordpress Themes.