[Resolved] Assign unique header element to parent pages to also display on child pages?

Home Forums Support [Resolved] Assign unique header element to parent pages to also display on child pages?

Home Forums Support Assign unique header element to parent pages to also display on child pages?

  • This topic has 9 replies, 4 voices, and was last updated 4 years ago by Tom.
Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #1224470
    Vera

    What I’m hoping (desperately) for is to have distinct headers for each of the main sections (parent pages) of my site without having to assign every single page on my site to a header element. This will become even more unwieldy when new pages are added down the line.

    I need the simplest possible setup for the web site owner. He doesn’t want to have to use any part of WordPress except for Pages, Posts, and the Media Library. So I’d like to predefine the web site sections (i.e., parent pages) with appropriate headers so he can just create pages under those sections and have the correct header element display automatically without him having to go into the elements settings.

    If it can be done with “parent-like” settings, I have not been able to figure out what they are called. I hope it exists and that I’m just looking for the wrong name!

    I would also like it to be possible for a parent header element to be overridden if I assign a different header element to any of its child pages. Then the child’s header element should apply to it and all it’s children in place of the original parent’s header element — unless one of the children has a different header assigned, and so on… Something this effect anyway.

    I hope this makes sense!

    Thank you.

    #1225131
    Leo
    Staff
    Customer Support
    #1225335
    Vera

    Thank you once again for the quick replies. It’s been such a relief to feel I can count on these because I have a looming deadline!

    So I assume I would create a separate Snippet for each parent page and change the ancestor page ID in the snippet code (45458 in example).

    I assume I also set up a header element. If so…

    1. How do I set up Display Rules in each?
    2. How do I tell the snippet which header element to display?
    3. Can I make it so there is a default header for all pages except those where I have already set up display rules AND, if I have a child that’s already following a parent’s display override, can I assign a parent rule to it that overrides it’s parent’s rules?

    If the answer to #3 is no, I may need to pass on this solution and just settle for a single header throughout for now as this may be too difficult for me to maintain — especially remembering the procedure after a few weeks or months. Aside from that, the more plugins I have to rely on, the more tricky it gets to keep all the updates compatible.

    It would be more user-friendly for non-coders like me if there was no need for a snippet and you could instead manage it all within element settings — like a display rule where you assign a parent page to control the display for all its child pages.

    Is there a specific way I should submit feature requests?

    #1225697
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    I can’t think of a way to make #3 work with the current set up.

    I wonder if it would simplify things if you added categories to pages?: https://wordpress.org/plugins/add-category-to-pages/

    That way you could add pages to specific categories, then assign the Header Element to those categories instead of a bunch of different pages.

    #1225762
    Vera

    I saw that option and it would be perfect except I don’t see where I can assign categories to pages — only posts. I’m not looking to put custom headers on blog posts. Is there an WP setting I missed that would allow that? I hope! 🤞🏼

    #1226017
    David
    Staff
    Customer Support

    Hi there,

    Tom provided the link to the plugin you’ll need to add Categories to pages:

    https://wordpress.org/plugins/add-category-to-pages/

    #1226407
    Vera

    That’s great! But the plugin hasn’t been updated in 6 months and says it’s untested with my version of WordPress. How likely is that to be a problem? Is there a “best practices” procedure users can follow to test a plugin in a staging setup?

    I would still like to add Parent-Child pages as a feature request for Element display rule options. This way I won’t have to be reliant on as many plugins that may stop being supported. Hopefully WP will also add categories for pages as a standard feature.

    Thank you!

    #1226587
    Leo
    Staff
    Customer Support

    That plugin should be fine – 6 months isn’t a very long time.

    #1226756
    Vera

    Okay, good. There have been a few updates to WP in that short time so I worried.

    #1226836
    Tom
    Lead Developer
    Lead Developer

    It should be fine – most well-coded plugins don’t need to be updated super often 🙂

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.