Widgetize your WordPress theme – a tutorial
If you have an WordPress account in wordpress.com you have probably seen that you can manage your sidebar dynamically. For this to work the current theme has to support widgets. Autmattic has come up with a plugin to enable this feature in a regular wordpress installation.
In order to widgetize your current theme all you have to do is register some functions and add a small amount of code to your sidebar.php. If you don’t have a functions.php in your theme create one and put this to it.
This is to register the sidebar as dynamic. Save and close we are done with functions.php
Let’s move on to sidebar.php and take a look how a regular file would look like.
To enable the widget support all we have to do is enclose the sidebar code in an if statement. Like this:
If you uninstall thw widget plugin or decide not to use it the default sidebar will be shown, the code within the if statement. Now go and install the widget plugin and you are set to go.
[...] I found Widget Enhanced Theme Switcher with its very cryptic information for a PHP dummy like me. I got some info at other places like here but never could get the thing to work. Looks like I might have to either get another theme that is Widget-ready or make due with only one theme and keep the blog that way. [...]
[...] I love this theme, the shade of green used, the tree, sun and the grey background. The only problem for me tho, was that I love my widgets. My little toys, my widgets are and this them came sans Widgets. So I widgetized this theme. Not hard at all if you follow the code given HERE. [...]
Hello!
Easy and simple tutorial! Worked great! Thanx!
Thanks heaps. This worked a treat for me.
how do i add functionality for TWO sidebars?
oh man, where were you in former times? I would have used it 2 months ago ago. nevertheless thanksfor tutorial!
Tjena! Intressant tips! Får det dockinte att fungera alls. Använder en grovt modifierad RDC*0.7 tema.. Och när jag följer instruktionerna så försvinner hela min sidebar.
*taps fingers on desk and wonders why nobody is postin*
“Postin” -Southern Verb, to post. lol
How would this be modified for a three-column layout? I have “sidebar” and “sidebar2″ in my sidebar.php.
This is very cool – I had a template that was not widget friendly, and I did not want to change templates…with this tutorial and 5 minutes, I was able to get widgets to work. FANTASTIC job – thank you!!
You know that thing about sense of humour.
If you ain’t got it then you won’t get it.
Keep it up…
Super toto, facile et rapide : ça a marché !
swingers movie trailers xxx shuttle tampon brands best for teens nude beach clips apics
best charge card offer professional career institute mahogany executive desk brandon stewart treme new orleans and governor nicholls
crf 100f
neutrogena advanced solutions fred meyer kennewick
Çàíèìàþñü äèçàéíîì è õî÷ó ïîïðîñèòü àâòîðà http://www.fahlstad.se îòïðàâèòü øàüëîí÷èê íà ìîé ìûèë) Ãîòîâ çàïëàòèòü…
[...] Widgetize your WordPress theme – a tutorial [...]