Archived topic
Page Hero Element for Parent + Child pages
5 replies · Started by jasper on December 22, 2020
Hello -
Just wanted to be sure I have the most current information.
I would like to use the wonderful Elements feature to display a certain page hero for each department.
For example:
Parent: Planning Dept.
Child: -- Permits
Child: -- Zoning
Child: -- Meetings
-- all get a special Hero. Then the Fire Dept. gets their own header, etc.
Is this possible using the Display Rules without selecting each page individually (we have over 100 pages) or do we use the solution posted here-
https://generatepress.com/forums/topic/how-to-set-an-element-location-to-child-of-a-parent-page/
Thank you!
-Laura
Hi there,
I believe this is what you are looking for:
https://generatepress.com/forums/topic/gp-hook-on-certain-child-pages/#post-1056464
Let me know :)
Thanks! Did this code cause the hero to display on both the parent and the child? That is what I was looking for. This goes into the functions file of the child theme, right?
Yup it should.
And yes it can be added using one of these methods:
Adding PHP: https://docs.generatepress.com/article/adding-php/
Thanks! I will be switching a site over in a few weeks and will use this feature. I am finding ways to use the elements all the time. They are great!
Glad to hear :)