[wp-hackers] Widgets that load at the same time as a theme is selected

Alister Cameron alister at alistercameron.com
Sat Aug 9 07:11:58 GMT 2008


Hi y'all.

I've been plugging away at this Vanilla theme that relies very heavily on
widgets.

I have dispensed with sidebars, and have instead widgetized the entire page,
which is more of what you'd expect in CMS "best practice".

No problems there.

However, when I install my theme it really doesn't look like much until I
manually go and grab a bunch of widgets, populate a few of them, and stick
them in the relevant widget blocks (sidebars, in the traditional
"language").

What I want is a way to do that automatically. Has anyone done anything on
this? I'm not a hard-core PHP dev, so it will take me a long time to do
this, hence wanting to know first what others may have done in this are.

Specifically I'm wanting to hook some "actions" together: when a theme is
installed I want to be able to add into the "init" event some way to
populate text widgets with some content and push them into a widget block
(sidebar).

I hope that makes sense.

Anyone done any of this??

Cheers,

-Alister

---
Alister Cameron // Blogologist
www.alistercameron.com

Mob. 04 0404 5555
Fax 03 8610 0050


More information about the wp-hackers mailing list