Working on FIW.ME!

We are currently working on fiw.me a next generation URL shortener!

Create your own WordPress theme from scratch [Part 4]

In previous tutorials we have coded header.php and content.php, now we shall code sidebar.php.

Sidebar is place where you can put widgets, or links or anything which is to be quickly available from every page in the blog/website.

WordPress has special feature to manage the sidebar, you just have to drag and drop the elements in the sidebar from dashboard, and that’s it, it will be live.

So, you have to choose what you want to put in side bar. Here am going to add search,categories, recent posts, archives, and web links.

Before doing that we must first register our sidebar, to do that we must first create a file named functions.php and add this code to it.

This will register a side bar called primary sidebar, and it will become available in the WP Dashboard.

wp-appearence-widgets

sidebar

Now add this code to the sidebar.php and save it.

Now , just drag and drop the widgets you want to show from dashboard and they will be live in no time.

NEXT PART:
Create your own WordPress theme from scratch [Part 5]

PREVIOUS PART:
Create your own WordPress theme from scratch [Part 3]