Some child themes already include 2 widgets side by side but they’re in a fixed location.
What if you want to change the location or your theme doesn’t include sub widgets?
You can add them anywhere there’s a hook using PHP and CSS code in your child themes files.
In this tutorial, i’ll show you how to add 2 responsive sub widgets, side by side in any Genesis child theme.
The widgets will be equal in width however you can easily change these values in the CSS code.
Register & Hook In 2 Widgets
Paste this code at the end of your child themes functions.php file.
You can change the hook and conditional tag based on your own needs.
Style Your Widgets
Add this sample code to your child themes style.css file.
You can easily change the values to adjust the width and other properties in this code.
This CSS code has been taken from the StudioPress Outreach theme and modified.
Customization
You’ll probably want to change the values for the padding, background and width of each widget which is easily done.
If you get stuck, the StudioPress community forum provides excellent support for custom CSS & PHP coding.
Otherwise, install the Firefox addon named Firebug and inspect each element so you can test your changes in real time before you change the code in your child theme.
Leave a Reply
You must be logged in to post a comment.