LUCiD GRAFiX Logo

Tutorial
YouTube RSS Feed
Search

TUTORIAL

How to add a Sidebar in WordPress

Written by Posted on March 8th, 2013 No Comments
Share This

How to add a sidebar in WordPress. Well, first your going to need these files:

  • functions.php
  • sidebar.php
  • template file, page.php, single.php, index.php, etc. Where ever your trying to add the sidebar too.

Copy the code below in to your functions.php Remember one is capital for you in the widget area and the other is lowercase and is the one that you will target from your code.

Next, open the sidebar.php and save it as sidebar-your_ID_you-chose_above.php.

For example purposes: sidebar-example.php

Now you can target your custom sidebar like it is below.

However this will only let you add custom code to the actual sidebar-example.php, No widgets will work.

To get widgets to work

You will need to copy this code into your sidebar-example.php

Remember it is good practice to have everything in your sidebar inside an aside tag.

Next, open template file, page.php, single.php, index.php, etc. Where ever your trying to add the sidebar too and add the code below to the desired file.

Now the widgets will work

How to add a Sidebar in WordPress

New Sidebar on the side.

How to add a Sidebar in WordPress

Remember until you drop an available widget onto your sidebar, you will have the default sidebar widgets as listed below:

  • Search Form
  • Pages
  • Archives
  • Categories
  • Meta

So if you don’t want those make sure you add an available widget in to your sidebar,
for more information check the WordPress codex.

About

Hi, my name is Eric Young. I’m a web designer who has worked in the IT industry since 2000. I love blogging and making the web a better place. If I'm not here I'm probably playing Gears of War. LOL

Related Articles You Might Enjoy!

Change Wordpress Avatar size Change WordPress Avatar size
How to install WordPress on WAMP How to install WordPress on WAMP
How to add featured Image in WordPress How to add featured Image in WordPress
Leave a comment

Leave a Reply