Archived topic
Do Header support php
5 replies · Started by Brian on September 18, 2018
Hi,
Just wondering, do custom headers support php? Also, in sections is it possible to have them at the same width as the rest of the site?
Kind regards,
Brian Thompson
Hi there,
What do you mean by custom headers?
Hooks should work if you need PHP in the header:
https://docs.generatepress.com/article/hooks-element-overview/
https://docs.generatepress.com/article/hooks-visual-guide/
Sections have container widths in settings as well:
https://docs.generatepress.com/article/sections-overview/#opening-the-section-settings
Let me know if this helps :)
Hi Leo,
Basically, I would like to make a custom header for the home page. I need to display the site title and description with the nav menu under it. I was wondering if I added the php into the custom headers section, would it be able to execute it?
I think I have resolved the problem with sections.
Kind Regards,
Brian Thompson
Hi there,
The Elements > Headers don't support PHP.
You would need to use a Hook as per the guides Leo provided.
Simply activate the Elements module in Appearance > GeneratePress.
Then from the Appearance menu Select elements and create a new Hook. Add your PHP and the assign the Hook you want it displayed in. If you choose the Header Hook you can chose to disable the GP one.
That's fine. Thanks for that. I have since tried to do it but it didn't work out. I didn't need to use php after all.
Kind Regards,
Brian Thompson
Glad you got it resolved.