Additional Widget Area


Widgets are brilliant. You can drag and drop them into widget areas and they supercharge your website with functions ranging from Newsletters, Social Media Sharing to Galleries and sliders.

Sometimes you might find that the area in your website where you want to place your widget, isn’t widgetized. The best solution, make your own additional widget area!

Activating Additonal Widget Area

You will need to activate the widget area in your WordPress Theme by making some changes to your function.php file. This can be found in your theme files.

To enable the widget area, you need to add the following code in function.php:-

if (function_exists('register_sidebar')) {
     register_sidebar(array(
      'name' => 'Additional Widgets',
      'id'   => 'additional-widgets',
      'description'   => 'Additional Widgets Area',
      'before_widget' => '<div id="one" class="two">',
      'after_widget'  => '</div>',
      'before_title'  => '<h2>',
      'after_title'   => '</h2>'
     ));
    }

If you are unsure of where to put this code, you can always keep it simple and put it at the very top of your functions.php like this:-

<?php

/**

* @YourThemeName WordPress

* @subpackage YourThemeName

*/

if (function_exists('register_sidebar')) {
     register_sidebar(array(
      'name' => 'Additional Widgets',
      'id'   => 'additional-widgets',
      'description'   => 'Additional Widget Area',
      'before_widget' => '<div id="one" class="two">',
      'after_widget'  => '</div>',
      'before_title'  => '<h2>',
      'after_title'   => '</h2>'
     ));
    }

You can change the name, id and description of your widget area. You must ensure that you keep this consistent through the code in order for it to work correctly.

Adding Your New Widget Area Into The Theme

Once you have activated your additional widget area using the steps above, you can integrate this into your theme layout. You will need to decide where you want your new widget area to show, and insert the following:-

<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Additional Widgets') ) : ?>
<?php endif; ?>

Now if you go into the Widget Area in your WordPress Dashboard, you will see your new widget area has been created. You are now free to drag and drop widgets into your new additional widget area!

Nov 4 2015 , , ,
Charly September 16th, 2017