Skip to main content
deleted 3 characters in body
Source Link
PrivateUser
  • 3.5k
  • 10
  • 54
  • 85

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

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

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

Source Link
PrivateUser
  • 3.5k
  • 10
  • 54
  • 85

How to customize wordpress sidebar widget

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