WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This is how i registered my sidebar:

register_sidebar(array(
        'name' => 'Post Sidebar',
        'before_widget' => '<div class="widgetdiv"><div id="%1$s" class="widget %2$s">',
        'after_widget' => '</div></div>',
        'before_title' => '<div class="titlediv">',
        'after_title' => '</div>',
    ));

The problem I have:

Title div wrapped inside widgetdiv. The above code output like this.

<div class="widgetdiv">
<div class="titlediv">My title
</div>
</div>

My requirement:

<div class="titlediv">My title
</div>
<div class="widgetdiv">
</div>

I mean titlediv should be outside widgetdiv

Can anyone give me good solution?. Thanks

share|improve this question
up vote 1 down vote accepted
register_sidebar(array(
        'name' => 'Post Sidebar',
        'before_widget' => '<div id="%1$s" class="widget %2$s">',
        'after_widget' => '</div></div>',
        'before_title' => '<div class="titlediv">',
        'after_title' => '</div><div class="widgetdiv">',
    ));

You will have a wrapper div, then your title div and then your widgetdiv.

share|improve this answer
    
Trust me dude. You are awesomeeeee.... Thankyou very much. – Giri Dec 27 '11 at 1:07

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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