Archived topic
Email Opt-in Banner for Different Post Categories
7 replies · Started by Carol-Ann on November 15, 2018
Hello!
I want to add an email opt-in form to the top of my posts (single posts only, not home page or other pages) as a banner above the title of the post but below the header/navigation bar. I have different email opt-in freebies for different categories and wanted to have this opt-in show up at the top of every post, depending which category the post is under. Does this make sense? And if so, is it possible with this theme?
Here are examples of one website using different opt-ins for different categories and having banners at the top of the pages for them
https://avocadu.com/health-benefits-of-hot-yoga/
https://avocadu.com/weight-loss-surgeries/
(I'm sure you see people reference this site a lot haha but I really do love this idea for my opt-ins).
Thanks in advance!
Hi there,
You should be able to use the Hooks Elements module:
https://docs.generatepress.com/article/hooks-element-overview/
Under Display Rules, select Post Category.
Let me know if this helps :)
That worked to get my form there!
The only problem I'm having now is that my form is in the far left corner. Is there any way to make it appear in the middle of the page?
Hi there,
if you are adding content to a hook you can wrap it like so, and it will respect your content widths and margins:
<div class="grid-container">
My shortcode / html / script etc.
</div>
Hmm it's still to the left of the screen. I think the issue is that there isn't a hook location for after my navigation bar but before my content title that is in a container independent of the content or sidebar. So I can only make it appear directly above my content, which is to the left of the screen (I have a sidebar on the right of the screen). Does that make sense?
Can you unlock coming soon page and guide me to the page in question?
Is there any way I can allow you to see the page without launching the website or providing a login? I have quite a lot of people who know my domain that I don't want to be able to visit until I've got the site a bit more put together. If not, I can come back to this topic after I launch if I still haven't figured it out.
Thanks for the response!
Not that I know of.
If you feel comfortable providing the login I can see it that way as well.
If not let's revisit the topic once it's live :)