Custom Body Class on Sub Page 'Depth=3'

Community Forums Forums Design Tips and Tricks Custom Body Class on Sub Page 'Depth=3'

This topic is: not resolved

Tagged: , ,

This topic contains 3 replies, has 2 voices, and was last updated by  Jen Baumann 1 year, 10 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #4135

    fortyfivecreative
    Participant
    Post count: 10

    Hi, wondered if you could help me to append a custom body class on child pages (excluding posts) that specifically have a depth of 3.

    i.e. Globally append ‘.three’ to: Page > Page > **This Page**

    without having to add the custom class manually to each page at this level.

    PS: Sample child theme used.

    Thanks

    #4234

    Jen Baumann
    Keymaster
    Post count: 424

    You could do something like this, but it assumes that your page depth is how you have it organized in the page hierarchy, not menu hierarchy.

    Due to code posting problems, I just made it a snippet here: http://dreamwhisperdesigns.com/?p=1112


    If you need technical support for your theme please file a ticket.

    The forums are community based. Staff only monitors the forum for issues relating to the forum itself and to redirect users to where they need to go.

    • This reply was modified 1 year, 10 months ago by  Jen Baumann. Reason: code posting issues
    • This reply was modified 1 year, 10 months ago by  Jen Baumann. Reason: code posting issues
    #4479

    fortyfivecreative
    Participant
    Post count: 10

    Perfect, thanks Jen.

    #4501

    Jen Baumann
    Keymaster
    Post count: 424

    Welcome!


    If you need technical support for your theme please file a ticket.

    The forums are community based. Staff only monitors the forum for issues relating to the forum itself and to redirect users to where they need to go.

Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘Custom Body Class on Sub Page 'Depth=3'’ is closed to new replies.