[wp-hackers] Sidebar widget HTML/DOM

Otto otto at ottodestruct.com
Thu Jun 24 19:05:23 UTC 2010


On Thu, Jun 24, 2010 at 1:50 PM, [ ravi ] <ravi-lists at g8o.net> wrote:
> Otto, I am not sure each widget will have a UL. For e.g the text widget does not, I think. This may be the case for custom/plug-in inserted widgets as well.

Fair enough. You can use after_title and after_widget to wrap the
contents of the widget in a div. That's the best way, although as you
pointed out, it's not 100% reliable.

The thing is, the widget itself controls what its contents are,
completely. Before and after widget will always be displayed, but
whether the widget displays the before and after title bits is really
entirely up to the widget. So there's no 100% way to do what you're
asking, since you can't control what the contents of the widget are.

-Otto


More information about the wp-hackers mailing list