[wp-hackers] Sidebar widget HTML/DOM

Andrew Nacin wp at andrewnacin.com
Thu Jun 24 19:11:44 UTC 2010


>
> 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.


If you want to include extra (and potentially unnecessary) HTML markup
instead of going the fully jQuery route:

before_widget - <div class="widget-notitle-content-container">
before_title - </div><h4>
after_title - </h4><div class="widget-content-container">
after_widget - </div>

I however would recommend using JavaScript, considering you are after all
looking to implement a JavaScript effect with show/hide of content on title
click. But I wanted to show how this could be done more reliably.


More information about the wp-hackers mailing list