Genius is nothing but great effort applied. – Awa Kenzo

How To: Add More Sidebars in Thesis

Adding more sidebars in Thesis (or any WordPress theme) is REALLY easy! It’s only three steps, and I’ll show you how to create 3 additional widgets to your footer.

Step #1: Insert the following code into custom_functions.php near the top

register_sidebar(array('name'=>'Footer Column 1', 'before_title'=>'<h3>', 'after_title'=>'</h3>'));
register_sidebar(array('name'=>'Footer Column 2', 'before_title'=>'<h3>', 'after_title'=>'</h3>'));
register_sidebar(array('name'=>'Footer Column 3', 'before_title'=>'<h3>', 'after_title'=>'</h3>'));

This code simply tells WordPress to “add a new widget space”.

Hint: You can change the name of the sidebar to meet your needs. Simply replace “Footer Column 1″ to whatever you’d like.

Step #2: Insert the following code into custom_functions.php near the bottom

// Footer Widgets
function footer_widgets_html() {
?>
 <div id="custom_footer">
 <div class="column1">
 <ul>
 <?php    if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Footer Column 1') ){    ?><?php    }    ?>
 </ul>
 </div>
 <div class="column2">
 <ul>
 <?php    if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Footer Column 2') ){    ?><?php    }    ?>
 </ul>
 </div>
 <div class="column3">
 <ul>
 <?php    if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Footer Column 3') ){    ?><?php    }    ?>
 </ul>
 </div>
 </div>
<?php }
add_action('thesis_hook_after_footer','footer_widgets_html');

Here we’ve setup a Function to build 3 columns inside the Thesis Hook: After Footer. The PHP just checks to see if there is a Sidebar named “Footer Column 1″, if there is print it.

Hint: If you change the names of the Sidebars, you must change them here too!

Step #3: Add the following code to custom.css

/* --- Footer Widgets --- */
#custom_footer { /* The parent DIV containing all 3 widgets */
 height: 350px;
 width: 100%;
 margin: 30px 0 0 0;
}
#custom_footer h3 { /* Headline color */
 height: 40px;
 font-size: 20px;
 color: #000;
}
#custom_footer a { /* Link color */
 color: #000;
}
#custom_footer ul li { /* Remove bullets */
 list-style: none;
}
.column1 {
 height: auto;
 width: 30%;
 margin: 0 0 0 15px;
 padding: 5px;
 float: left;
}
.column2 {
 float: left;
 height: auto;
 width: 30%;
 margin: 0 0 0 15px;
 padding: 5px;
 float: left;
}
.column3 {
 height: auto;
 width: 30%;
 margin: 0 0 0 15px;
 padding: 5px;
 float: left;
}

Here we just add some quick styling to line-up all 3 columns next to each other. The end result, while basic, gets you headed in the right direction

Greg Rickaby runs on the Genesis Framework

Genesis Framework

The theme you're viewing is the eleven40 Child Theme, which was built on Genesis.

Genesis empowers you to quickly and easily build incredible websites with WordPress. Whether you're a novice or advanced developer, Genesis provides the secure and search-engine-optimized foundation that takes WordPress to places you never thought it could go. It's that simple - start using Genesis now!

Take advantage of the 6 default layout options, comprehensive SEO settings, rock-solid security, flexible theme options, cool custom widgets, custom design hooks, and a huge selection of child themes ("skins") that make your site look the way you want it to. With automatic theme updates and world-class support included, Genesis is the smart choice for your WordPress website or blog.

Comments

  1. Ed says:

    I’m just getting into creating a Genesis child theme. I registered a sidebar, stuck a text widget in then used dynamic_sidebar(sidebar_name) to display it. The problem: both the sidebar name and widget contents are displayed. How do I just print the widget contents?

  2. Lyndon says:

    Thanks for the very clear and concise post about how to add widgets :)

    I’ve always wondered how to do it and even tried before and messed up my site. So it’s nice to finally get it to work!!

Speak Your Mind

*