Archived topic
Top Search Bar over Sidebar Header
3 replies · Started by Samuel on January 15, 2022
I have a site for a client that wanted sidebar navigation. I used this example: https://docs.generatepress.com/article/header-examples/#example-7 to move the top navigation to a sidebar. Now they would like a search bar that goes across the entire top of the site just above the page content. If I add it using the "before header" hook it only adds a search bar above the main content instead of being across the entire top of the page including the navigation sidebar.
Do you have any sample code for adding a top information bar above the page when main navigation is implemented in a sidebar?
Hi there,
the generate_before_content hook is positioned at the top of main content container - see here:
https://docs.generatepress.com/article/hooks-visual-guide/#single-post
Yes--but the problem is that because I'm using the sidebar navigation option, the content appears above the main content area, but not above the entire page. The sidebar navigation goes all the way to the top. I'm trying to get a search bar to go across the entire page not just the main content area.
Hi Samuel,
Try generate_inside_site_container hook or generate_after_header.
Let me know :)