How to make a widgetized sidebar
You are familiar with the wordpress Widgets section. You can drag and drop things to your sidebar: recent posts, latest posts. It is a good wordpress feature.
What about if you want to edit stuff on other locations of your website directly from the admin panel ? For example a portion of your header or footer, or you just simply want to add another sidebar.
It is simple, in the template file you want to add a section where you will drag and drop widgets, use the following code:
You’re not done yet. Now you have to register the sidebar. We called the sidebar “sidebar1”.
Open functions.php file and then paste the following code:
Now you’re done. It is still called sidebar, but you can use it on your header, footer or homepage.
Disclosure: Some of the links in this post are "affiliate links." This means if you click on the link and purchase the item, I will receive an affiliate commission
March 24th, 2010 at 11:22 am
It’s also worth mentioning that you can register multiple sidebars, and this way have more flexibility with the design.
Useful post! thanks
March 24th, 2010 at 11:25 am
Thank you for the completion, i forgot to mention that. You can add as many “sidebars” as you want, anywhere you want.
There is a bad aspect too, it will be still called sidebar even if it is placed on header or footer 🙂