In the members-only forum, a user asked:
Last year I bought a third party childtheme - Summation by EngageWP. summation
It has a pretty unique feature: In Genesis Theme settings, it adds a setting where you can define the number of widget areas you'd like to have dynamically created for your frontpage. Fill in - save - done.
I wonder if it's possible to create something like this for Genesis Sample?
In this tutorial we shall
- add a setting and corresponding control in the Customizer to change the number of front page sections using a number type input field. The default value appearing here (5) can be changed in the code.
- get the number of front page sections set in the Customizer and write a for loop to dynamically register that many widget areas.
- create a function to output the front page sections using another for loop and call this in the Content area of a static full width front page.
While the tutorial has been written for Genesis Sample, it works with a few modifications in any Genesis child theme.
Step 1
Add the following in child theme's functions.php
:
To view the full content, please sign up for the membership.
Already a member? Log in below or here.
So happy you considered my question for this tutorial – canΒ΄t wait to try this! π
Thanks much, Sridhar!
Wow, if you took the additional step of setting up the front page sections to hold flexible numbers of widgets, you’d have a totally hands-off home page generator right in Customizer! Wouldn’t you? Really nice!
π
I was thinking the same, may be good for rainmaker themes where adding new widget areas can’t be done without resubmitting the theme.