PLEASE BACK UP YOUR WORDPRESS THEME BEFORE EDITING ANY PHP FILES, just incase…
below is a chunk of code that tells WordPress that you want to register a new widget area for your website. It needs to be pasted into yourfunctions.php file. You can find this by logging into your WordPress dashboard, then clicking on Appearance, then click Editor, then select functions.php. If you do not have any of these options in your theme it is most likely that your theme developer / web designer has blocked your from accessing them, so please contact them with further questions.
if (function_exists('register_sidebar')) {
register_sidebar(array(
'name' => 'Extra Widgets',
'id' => 'extra-widgets',
'description' => 'The extra widgets for your website.',
'before_widget' => '<div id="%1$s" class="widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<h2>',
'after_title' => '</h2>'
));
}
Now WordPress will add a new Widget area called Extra Widgets. This is because as you can see in the code above, I gave it the ‘name’ Extra Widgets. If I had called the ‘name’ value ‘Header Widget’ for example, then I would have a widget area called Header Widget, in my WordPress widget control panel. Wow thats a lot of widgets in a sentence!
IMPORTANT NOTE!
This code can be copied and pasted into your functions.php as many times as you want, to make as many widget areas as you like. Be sure to change the ‘name’, ‘id’and ‘description’ for each widget area.
This code can be copied and pasted into your functions.php as many times as you want, to make as many widget areas as you like. Be sure to change the ‘name’, ‘id’and ‘description’ for each widget area.
Step 2 – Call up the widget in your theme template php files
Enter this code into your theme files (e.g. page.php, single.php, header.php, footer.php)
<ul><?php if (!function_exists('dynamic_sidebar') || !dynamic_sidebar('Extra Widgets')) :endif; ?></ul>
