How to add sidebar in Twenty Eleven WordPress Theme

advertisement

when i installed wordpress theme  twenty eleven then i found that there is no sidebar option in single post,tags or in even archive options.I felt the need of it in order to make my theme more beautiful and attractive.i did some modification in its php code and have sidebar in each option  or where ever i felt its need.i want to share with you,just stay with me.

How to add sidebar in Twenty Eleven WordPress Theme:

Go to admin panel >>>.click on the edit option under Appearance..then >>>  open up your single.php template and find the call for the footer:

php get_footer(); ?>

You simply need to add a call to the sidebar above this function like this:

php get_sidebar(); ?>

You should repeat the above step in your page.php template if you want to add a sidebar to your pages too.

The last thing you need to do is open your functions.php template then go to the bottom of the template and remove the function from line 581 to  592 (you should the file in some editor like Notepad ++,you can download this one from web)

twenty eleven_body_classes. Bart advises that you simply comment the code out so it can be added later however I don’t think there’s any need as long as you have a back up of Twenty Eleven on your computer.

That is all you done.you can add the side bar function where ever you want.

Leave a Reply