Register Sidebars


/*
* Legal Main Sidebar
*/

function legal_widgets_init() {

register_sidebar(array(
'name' => __('Main Sidebar', 'legal'),
'id' => 'sidebar-1',
'description' => __('Main sidebar that appears on the right.', 'legal'),
'before_widget' => '<aside id="%1$s" class="sidebar-widget widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
));

register_sidebar(array(
'name' => __('Footer Area One', 'legal'),
'id' => 'footer-1',
'description' => __('Footer Area One that appears on footer.', 'legal'),
'before_widget' => '<aside id="%1$s" class="footer-widget widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h3>',
'after_title' => '</h3>',
));

register_sidebar(array(
'name' => __('Footer Area Two', 'legal'),
'id' => 'footer-2',
'description' => __('Footer Area Two that appears on footer.', 'legal'),
'before_widget' => '<aside id="%1$s" class="footer-widget widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h3>',
'after_title' => '</h3>',
));

register_sidebar(array(
'name' => __('Footer Area Three', 'legal'),
'id' => 'footer-3',
'description' => __('Footer Area Three that appears on footer.', 'legal'),
'before_widget' => '<aside id="%1$s" class="footer-widget widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h3>',
'after_title' => '</h3>',
));

register_sidebar(array(
'name' => __('Footer Area Four', 'legal'),
'id' => 'footer-4',
'description' => __('Footer Area Four that appears on footer.', 'legal'),
'before_widget' => '<aside id="%1$s" class="footer-widget widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h3>',
'after_title' => '</h3>',
));
}

add_action('widgets_init', 'legal_widgets_init');



Display:


<div class="col-md-3 col-sm-6">
<?php if (is_active_sidebar('footer-1')) { ?>
<div class="footer-widget">
<?php dynamic_sidebar('footer-1'); ?>
</div>
<?php } ?>
</div>

Advertisements

Tagged:

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: