Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

In this subject you can wrap a widget with the title outside but if you don't want a title, a <div> will not be closed, and the template is broken. So I would like to do this in jQuery instead of the widget function. I tried many times but it doesn't work!

My jsfiddle code here

share|improve this question

closed as off topic by Wyck, Chip Bennett, toscho Apr 10 '12 at 19:26

Questions on WordPress Development Stack Exchange are expected to relate to WordPress within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

    
Close-voted as off-topic. As currently written, this is a jQuery question, not a WordPress question. –  Chip Bennett Apr 10 '12 at 17:11

1 Answer 1

I updated your jsfiddle: http://jsfiddle.net/geertdd/gNzun/3/

var $widget = $('.widget');
$widget.wrapInner('<div class="inner_widget" />');

var $title = $('.widget_title').remove();
$widget.prepend($title);
share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.