user678978
user678978

Reputation:

How to use custom widgets in wordpress

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

Upvotes: 0

Views: 120

Answers (2)

Chetan
Chetan

Reputation: 102

I suggest You must have to register to create new three different sidebars. because WordPress does not provide a multiple CSS in one sidebar.

Upvotes: 1

Bhavik Patel
Bhavik Patel

Reputation: 11

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' ); ?>

Upvotes: 0

Related Questions