Archived topic
Adding ribbon below header
3 replies · Started by Sufia on July 8, 2021
Hi, I have an affiliate disclaimer on many of my posts (check the private information box). I want to create a ribbon right below the header and place the disclaimer in there. I tried the top bar widget but it creates a ribbon above the header. Also, the ribbon appears throughout the site. I only want the ribbon on posts not pages and certainly not the homepage.
Any idea how to achieve this? Is there a plugin that you would recommend or maybe we can add some CSS? Whichever option doesn't slow down my website.
It's probably worth mentioning that I would love to have the flexibility to control the background color of the ribbon. If you see the disclaimer I have on my posts right now, I would love to retain that background color.
Hi there,
you can use a Block Element:
https://docs.generatepress.com/article/block-element-overview/
Within the new block element - build you disclaimer with GenerateBlocks ( like you have in your content ).
Then set the Hook to: after_header this will place it immediately after the site header. If you want it below your page hero then increase the priority to 25
Then in the Display Rules > Locations - select Posts > All Posts
Tried it on my staging site. It worked. Thanks a lot, David :)
Glad to be of help!