Archived topic
Hook Element to Replace Site Header Not Working
10 replies · Started by Vernon Lees on October 28, 2019
I've added a new element Type 'Hook' and set to header, disable site header and execute PHP. Set for entire site apart from front page.
Added the following code :
It's not replacing the existing Site header.
I've also separately tried adding a new layout element and setting this to disable the Site Header - set for entire site apart from front page, but this doesn't seem to be working either.
What am I missing?
Thanks in advance. :)
Hi there,
Not exactly sure what you are trying to achieve here but would header element work better?
https://docs.generatepress.com/article/header-element-overview/
https://docs.generatepress.com/article/page-hero-examples/
The template tags only work there.
If not any chance you can provide an example of what the final result should be?
Let me know :)
Hi Leo
Thanks for the super fast response as ever!
I've used the header element here to pull in the title in the example. I want to get rid of the Site Header. I can use CSS but I thought that the layout element would be able to disable this?
Are you looking to disable the site header globally and just keep the header/navigation style?
If so try checking this option:
https://docs.generatepress.com/article/navigation-as-a-header/
Let me know :)
Hi Leo
Yes that's correct. However when I go to Customsing Layout / Header I don't get the option to 'Use Navigation as Header' shown in the link. :-( I'm on 1.8.3 version of the Plugin.
Try removing the navigation logo first then the option should show :)
Hmmm. So I removed the image and the option appeared. However it has not got rid of the site header.
I should add as well that this is only affecting the desktop view not the mobile view.
That's strange. The option should definitely remove the header when activated.
What happens if you remove the site logo then re-add it?
Hey Leo. I found the answer!
I was using a child theme and I guess it did not support the latest changes etc!
Frustrating but glad to have found the issue. THanks for your assistance in helping me get to the bottom of this. :-)
Make sure this is not the issue otherwise there will be more customizer option problems:
https://docs.generatepress.com/article/child-theme-issues/#import
Glad I could help :)