Archived topic
Can I have different sidebars for different posts?
6 replies · Started by Kelsey on February 15, 2022
The majority of my posts are recipe posts. But I'd like to write a few product review posts. The sidebar I use for recipe posts doesn't make sense to have show up with my review posts, so I'd like to show a different side bar. Can I accomplish this with Generate Press?
Hi Kelsey,
Do you want to switch the recent post widget on review posts?
If so you can remove the popular posts widget, then use a block element instead: https://docs.generatepress.com/article/block-element-overview/
Add alatest posts or posts listblock to the element, Choose hookas element type, choose after_right_sidebar_content as hook name. Select the recipe posts as location. So the part will only show on recipe posts.
You can do the same for the review posts.
Let me know if there's anything unclear.
Hi Ying,
I'd like to have a completely different sidebar on certain posts vs other posts.
Then you can use a block element, choose right sidebar as element type.
So you can build the entire sidebar in the block element, it will replace the default sidebar built with widgets.
Thanks, Ying. Is there a more comprehensive guide on this method? I appreciate your help. I hadn't thought of this.
I think I figured it out!
Glad to hear that :)