Add Classes to Page Header addon

Home Forums Support Add Classes to Page Header addon

Home Forums Support Add Classes to Page Header addon

  • This topic has 21 replies, 4 voices, and was last updated 6 years ago by Paul.
Viewing 7 posts - 16 through 22 (of 22 total)
  • Author
    Posts
  • #518837
    Katie Jones

    Tom – oh dur, I didn’t even notice that! That’s much easier, thank you!


    @pracko
    – Now I remember why I did the body class, it’s a special case – I’m adding something special after page headers for style purposes, Tom’s solution is probably a better jumping off point. Or, if you really want to group headers & use my code to create body classes based on those groupings, you could use a plugin like Advanced Custom Fields to add a field to page headers (say, a drop-down with categories, select a category) & pick it up in that code / add a body class accordingly.

    #518917
    Tom
    Lead Developer
    Lead Developer

    Got it, I do think a class field within the Page Header is the way to go.

    I’ll get that added ASAP 🙂

    #519064
    Paul

    Wow, that is super awesome Tom. I really think this will be useful with sites that have multiple departments/sub-sections/areas and that also have a number of different post types or custom post types within each area of the site. This way, the page headers linked together with a unique class can be used as a unique page taxonomy for overall page styling purposes within that site area. Cheers!

    #519288
    Tom
    Lead Developer
    Lead Developer

    I agree. It likely won’t make it into 1.6, but it will definitely be in 1.7, and might even be in 1.6.1.

    #519331
    Paul

    That would be great. Oh, and please make sure the class is added to the body tag rather than the page-header-n div.

    #519333
    Tom
    Lead Developer
    Lead Developer

    I’m not sure that would make sense for the plugin to do – it should definitely be added to the surrounding div.

    However, once the field exists, we can write up a custom function to add it to the body for your use case.

    #519935
    Paul

    OK, having a custom function to add the class to the body tag would work too. That way the entire group of pages could be more easily styled to be consistent with each another.

Viewing 7 posts - 16 through 22 (of 22 total)
  • You must be logged in to reply to this topic.