Last week I added a section to No Sidebar called Daily Reads. This was something I had been wanting to do for some time, and I thought my visitors would appreciate hand-picked articles with relevant topics written by members of our community.
Any content producer knows that capturing emails is essential to building an online business, so I knew I had to include an email opt-in on this page.
I didn’t want to disrupt the integrity of the page design, so I knew that placing it at the top of the page wasn’t an option. I also knew that I didn’t want to risk losing potential emails by placing it at the bottom either, especially since I knew the page would contain 15 posts—which would require quite a bit of scrolling for anyone to even see my form.
This left only one option, which was somewhere in the middle of the page. Thankfully the Genesis Framework is built with functions and filters, so I knew that doing this would be fairly simple.
Here are the steps I used to add a newsletter widget in between posts:
1. Register the Newsletter widget area in the functions file:
*Note: Feel free to place this snippet at the bottom of the functions file.
2. Create a file called category-daily.php (replace “daily” with the category slug of your choice), and use the code below, which customizes the loop to display the newsletter widget area after the 6th entry on the page:
If you want this widget area to display on every category page, you can simply name your file category.php. Likewise, to display this on a every tag page, name your file tag.php, or on every author page, name your file author.php.
If you’re looking to add your newsletter section in another location, here’s a comprehensive list of Genesis Hooks for you to use as reference.
We have published additional Genesis Quick Tips for you, so feel free to use what you see to build something awesome.