0

I am just newbie to the wordpress. Now I am doing developing a theme as a child theme of twentyeleven. Now when I am doing customization to my widgets style as per my required style. But in my reference style I can see there are different styles widgets. Its easy to to one single type widget in a sidebar and using the css. Now I have three different types of widget style. Here with I am attaching the images of the widgets. So can someone tell me how to use different types of widget in a single page? Any help and suggestion will be highly appreciable.

enter image description here

4

2 回答 2

1

我建议您必须注册才能创建新的三个不同的侧边栏。因为 WordPress 没有在一个侧边栏中提供多个 CSS。

于 2012-12-03T12:19:41.640 回答
0
put in child theme function file 
    "<?php

add_action( 'widgets_init', 'my_register_sidebars' );

function my_register_sidebars() {


    register_sidebar(
        array(
            'id' => 'primary',
            'name' => __( 'Primary' ),
            'description' => __( 'A short description of the sidebar.' ),
            'before_widget' => '<div id="%1$s" class="widget %2$s">',
            'after_widget' => '</div>',
            'before_title' => '<h3 class="widget-title">',
            'after_title' => '</h3>'
        )
    );


}

?>"

put in sidebar.php 
<?php dynamic_sidebar( 'primary' ); ?>
于 2012-12-03T11:56:52.003 回答