Archived topic
Sidebar per category and posts within that category
7 replies · Started by Liam on March 10, 2022
Hi there,
I'd like to create a sidebar - with widgets - which shows on specific category pages and posts which are within that category.
For example, if I have an email marketing category, I would like the email marketing category page and all posts within it to show a sidebar with widgets offing an email marketing newsletter signup, etc.
Is there anywhere you can point me to which describes how to set this up?
Thanks.
Hi Liam,
One approach you can do is to set a Layout Element making the sidebar visible for your preferred locations.
See: https://docs.generatepress.com/article/layout-element-overview/
Then, you can use either a Hook Element or a Block Element to add your email marketing newsletter signup and other Blocks.
See: https://share.getcloudapp.com/nOuRwvEk
Also see: https://share.getcloudapp.com/X6uErlWy
Here is a sample video where a Block Element is used to add Blocks to the sidebar: https://www.youtube.com/watch?v=1E7zFl678kg
Hope this helps! :)
Cool. Thanks, Fernando. Will take a look.
You’re welcome Liam! Feel free to reach out if you’ll need further assistance with regards to this!
Hi Fernando,
Just one more question on this. Is it also possible to create a sidebar per specific post?
For example, I would like to create a sticky widget called "Mentioned in this post" which keeps affiliate links omnipresent as the user scrolls. The affiliate links would be specific to a post so the widget would have to have a one-to-one relationship with a post.
Thanks.
Yes, if you use an Element to add this functionality to the sidebar, or add it as a Widget, this should be possible but the effectivity/functionality of this would be reliant on the custom code or plugin you’ll be using. :)
Cool, thanks Fernando ✌️
You’re welcome Liam! Glad to be of assistance! :)