Archived topic
A GP block hook dilemma - Display before one sidebar but after the other?
1 reply · Started by ajetwebmaster on February 7, 2022
Hello! Firstly, thank you for providing such excellent support for GeneratePress. I've solved almost everything I've needed to solve by browsing through these forums.
Now, I've got a dilemma here and I'm wondering if you have any insight. Basically, I want to create this:
And I've currently got this: https://beta.ajet.net/finding-a-job-after-jet/
I've currently got two sidebars. #left-sidebar is the navigation, and #right-sidebar displays the table of contents. Both are sticky. Is it possible to have a GP block (in this case, the big hero image with the page title) display before one sidebar but not before the other one with the display options offered by GeneratePress?
I've considered:
1. Going into the site code and wrapping the content and right sidebar in a container, then creating a custom hook to place my GP block in (I've never done this before, but it should be doable, right?)
2. Making the table of contents a GP block instead of a widget in #right-sidebar...but my TOC plugin isn't available in the GP block element editor.
Any advice would be greatly appreciated. Thank you!
Hi ajetwebmaster,
Yes, the screenshot you provided should be doable. One easier way I can think of is to add an image block for you logo on top of the left side bar, and make the position of the div inside the sidebar, including the logo, to be fixed.
Here is a CSS code you can try:
@media (min-width: 769px){
.inside-left-sidebar {
position: fixed;
width: inherit;
top: 73px;
border-right: 1px solid #e6e6e6;
}
}
Here is how it would look like without the logo with the code provided: https://share.getcloudapp.com/o0uZO84v
Hope this helps! :)