Beth Thomas, Beth Motta Design & Marketingby: Beth
on: July 11th, 2013
in: News

Creating Custom Widget Areas in WordPress

If you have the need to create a custom widget area in WordPress for a section of your site which doesn’t already have a widget area, the steps are pretty simple.

First, create the widget areas in your functions.php file:

if ( function_exists('register_sidebar') )
register_sidebar(array(
‘name’ => ‘Sidebar 1’,
‘id’ => ‘sidebar1’,
‘description’ => ‘Some description text here’,
‘before_widget’ => ‘<div class=”sidebar-one”>’,
‘after_widget’ => ‘</div>’,
‘before_title’ => ‘<h3 class=”widget-title”>’
‘after_title’ => ‘</h3>’
));

register_sidebar(array(
'name' => 'Sidebar 2',
'id' => 'sidebar2',
'description' => 'Some description text here',
'before_widget' => '<div class="sidebar-two">',
'after_widget' => '</div>',
'before_title' => '<h3 class="widget-title">'
'after_title' => '</h3>'
));

Then simply call your custom widget area within the appropriate WordPress template:

<?php
if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Sidebar 1') ) :
?>
<?php endif; ?>

CATEGORIES: News

Don't forget to share this tip:

Comments are closed.

Similar articles. . .

BMD&M Teaches Kids Coding, Participates in Hour of Code

Beth Thomas, owner and lead developer for BMD&M, shared some of her coding knowledge with her daughter, Gemmah’s first-grade class at South Elementary School, as…

News, December 13th, 2016
Read.

BMD&M Owner & Lead Designer Shows Her Artistic Side in Exhibition

BMD&M’s own Beth Thomas was featured in a faculty and staff art show at Bristol Community College(BCC). The BCC Art and Design Faculty Exhibition 2016,…

News, December 13th, 2016
Read.

Sign up to recieve occasional insight and BMD&M updates.