• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Custom Body Class on Sub Page 'Depth=3'

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

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

This topic is: not resolved

Tagged: body, class, custom

  • This topic has 3 replies, 2 voices, and was last updated 10 years, 1 month ago by Jen Baumann.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • December 10, 2012 at 4:45 am #4135
    fortyfivecreative
    Member

    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

    December 10, 2012 at 12:57 pm #4234
    Jen Baumann
    Participant

    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

    December 11, 2012 at 7:08 am #4479
    fortyfivecreative
    Member

    Perfect, thanks Jen.

    December 11, 2012 at 9:50 am #4501
    Jen Baumann
    Participant

    Welcome!

  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Custom Body Class on Sub Page 'Depth=3'’ is closed to new replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2023 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble