WordPress.org

Ready to get started?Download WordPress

Forums

No Child Pages Body Class (3 posts)

  1. blg002
    Member
    Posted 4 years ago #

    I'm implementing a site where some of the subpages have a sub navigation and others don't, here is a sample site map for instance...

    Home
    -About
    --About Me
    ---What I do
    ---Who I am
    --About You
    -Why
    -Portfolio
    -Resources
    -Contact

    The design calls for a left sidebar for the nav and a right larger content area. If there is no subnav (in the case of "Why", "Portfolio" etc.) the left sidebar goes away and the main content area expands to the full width of the rest of the sight. There are also faux columns in play here.

    Because of all this I would ultimately like to just set a class of "no-sub-nav" on the body tag (in header.php). Being relatively new to using WordPress as a CMS I'm having trouble with this.

    FYI: All of the pages are set up using pages to control content, I've set "Front page displays: A static page". For now I'm just using a different template if it is a page without any child pages.

    Any help is appreciated, thanks for your time.

  2. esmi
    Forum Moderator
    Posted 4 years ago #

  3. blg002
    Member
    Posted 4 years ago #

    I believe this is just testing if the page is a subpage or not. I need to test if the page has subpages.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.