How to implement dynamic_sidebar( ‘primary-widget-area’ ) with the given html in wordpress

I am working on wordpress site.I am using by default sidebar.php of wordpress.I shows sidebar in <ul><li></li></ul> and the problem is i want to customize this sidebar according to given html.

I need the things in <div>.Please help me its very urgent.I shall be very thankful to u all.
Please reply me asap .

Read More

By Default sidebar.php code

  <?php

/**
* The Sidebar containing the primary and secondary widget areas.
*
* @package WordPress
* @subpackage Twenty_Ten
* @since Twenty Ten 1.0
*/
?>

    <div id="primary" class="widget-area" role="complementary">
        <ul class="xoxo">
        <li id="search" class="widget-container widget_search">
            <?php get_search_form(); ?>
        </li>

        <li id="archives" class="widget-container">
            <h3 class="widget-title"><?php _e( 'Archives', 'twentyten' ); ?></h3>
            <ul>
                <?php wp_get_archives( 'type=monthly' ); ?>
            </ul>
        </li>

        <li id="meta" class="widget-container">
            <h3 class="widget-title"><?php _e( 'Meta', 'twentyten' ); ?></h3>
            <ul>
                <?php wp_register(); ?>
                <li><?php wp_loginout(); ?></li>
                <?php wp_meta(); ?>
            </ul>
        </li>

    <?php endif; // end primary widget area ?>
        </ul>
    </div><!-- #primary .widget-area -->
    <div id="secondary" class="widget-area" role="complementary">
        <ul class="xoxo">
            <?php dynamic_sidebar( 'secondary-widget-area' ); ?>
        </ul>
    </div><!-- #secondary .widget-area -->

Thanks

Related posts

Leave a Reply

2 comments

  1. You practically wrote down your solution. just replace the <li>‘s with <div>‘s and remove the <ul></ul> tags on the sidebar.php file. Then edit the CSS file of your theme to match the style you want to achieve. As I don’t know which theme you are using I cannot give you specific CSS instructions.

  2. IMHO, you can replace the “li” with “div” but as “li” is the default tag that wordpress provides or uses why not stick to the use of “li”?? using both are quite similar…