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 2 years, 8 months ago.

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

    fortyfivecreative
    Participant

    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

    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

    • This reply was modified 2 years, 8 months ago by  Jen Baumann. Reason: code posting issues
    • This reply was modified 2 years, 8 months ago by  Jen Baumann. Reason: code posting issues
    #4479

    fortyfivecreative
    Participant

    Perfect, thanks Jen.

    #4501

    Jen Baumann
    Keymaster

    Welcome!

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

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