Dynamically Adding Four Footer Widget Areas

Welcome to WordPress. This is your first po

These days, many WordPress themes have a number of widget areas in the footer, meaning you can create a “fat footer” with multiple widget areas side by side. It’s something I use on all of my themes.

But what if your theme has four widget areas but you only want three widgets? If you’re not careful, you’ll end up with an ugly gap on the right-hand side where the empty fourth widget area is.

In this tutorial I’ll show you how to avoid this using a combination of conditional tags in PHP and some Object-Oriented CSS (OOCSS), which will check how many widget areas you’ve populated and automatically resize them so they each take up the right proportion of the page’s width.

st. Edit or delete it, then start writing!