How to Add a New Gabfire Widget Zone

Home » Tutorials » Theme Tutorials » How to Add a New Gabfire Widget Zone

Sometimes, the standard widget zones that come with a theme are just not enough to bring your website to life. You may want to add a new widget zone to our theme in order to place an ad widget or text. It’s a very simple procedure that can be accomplished in 3 steps.

1. Register a New Widget Zone

In order to add a new widget zone, you’ll need to register it in our widgetize-theme.php file. FTP to your server and navigate to wp-content > themes > theme-name > inc > widgetize-theme.php (or theme-name > functions.php) and add this code to the bottom of the file.

gabfire_register_sidebar(array('name' => 'New-Widget-Zone', 'id' => 'New-Widget-Zone', 'description' => 'This is the new widget zone description!'));

Rename the id, name, and description as necessary, then save the file and your new widget zone will be registered.

2. Call the New Widget Zone

Now that your widget zone has been registered, you’ll need to call it within the other theme files. Usually, widget zones are placed in single.php, archive.php, or home.php, but there are a few other options for widgetizing your theme files. Just add this code to the theme file of your choice:

<?php gabfire_dynamic_sidebar('New-Widget-Zone'); ?>

Make sure the text matches your the id of the widget zone you registered. You can add widget zones to multiple files if you want the same widgets to appear in those screens. If you’re in doubt, feel free to ask us where to place the code by opening a new support thread on our forum.

3. Add Widgets to the New Widget Zone

Congratulations, you now have successfully added a new widget zone and called it within the theme. Now you can add widgets to the widget zone in Appearance > Widgets. Hope this helps!

What widget zone will you add?