I really like this theme for WordPress and wanted something not so graphically intensive as Behemoth Gaming. However I wanted to add some widgets to the footer and this theme by default does not have a widgetized section.
Luckily for us that is easily solved. So how do you add a widget-ready section to your WordPress theme? Let’s show you how to do it!
The first thing I would recommend is make a child theme so that if your original theme gets updated your changes are not lost. But we aren’t covering that in this post so we will assume you either have a child theme or are confident you won’t overwrite your changes.
Using your choice of PHP editor (you can also easily do this from the Appearance Editor menu in WordPress if you wish) navigate to your functions.php file. What you are looking for in this file is some code that looks like “register_sidebar”. This tells your WordPress them what widget sections you have. In this theme the code I was looking for looked like this:
register_sidebar(array( 'id' => 'right-sidebar', 'name' => 'Right Sidebar', 'before_widget' => '<aside>', 'after_widget' => '</aside>', 'before_title' => '<h3>', 'after_title' => "</h3>", ));
This adds my sidebar so I can use the handy drag-and-drop widgets. In that same block of code (actually I did mine in my child theme but either way) I added this chunk of code which is very similar:
register_sidebar(array( 'name' => 'Footer', 'before_widget' => '<div>', 'after_widget' => '</div>', 'before_title' => '<h3>', 'after_title' => '</h3>', ));
We have a couple options here. First is the name, which is the name of the widget section that we will be adding to the rest of our code in a minute. When you look to add widgets to this section, this is the name of the container as you drag them around.
The before_widget is any chunk of HTML you would like to be placed before your widget. As you can see, this is usually some opening tag but can also include anything you want. Want an image before every widget? You can do that too.
The other three options should be self-explanatory as well. These give you fairly robust control over the appearance of your widgets.
Now that we have defined the style and name of our widgetized section, we actually need to add the location for it to live within our template files. Within my footer.php I added the code:
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar("Footer") ) : ?> <?php endif; ?>
Change the word “Footer” to whatever you named your new section in your functions.php file and save it. Provided all the code is correct you can now browse over to your Widgets menu and start adding!
Let me know if you have any problems or corrections!