WordPress.org

Ready to get started?Download WordPress

Forums

Problem with CSS triggering off of body_class tags? (2 posts)

  1. jayceeco
    Member
    Posted 2 years ago #

    I've got a "Bare Page" template added to the Twenty Eleven theme. To get a different style I'm using "My Custom CSS" plug-in (which Rocks) to do page-specific CSS, based on the class .page-template-bare-page-php which I get from body_class().

    These rules work fine:
    .page-template-bare-page-php .entry-header {
    display: none;
    }
    .page-template-bare-page-php .entry-content {
    width: 100%;
    }
    .page-template-bare-page-php .entry-content {
    padding: 0;
    }

    But...
    This one doesn't work with the .page-template-bare-page-php in it. If I take it out, it does.

    /* Doesn't work */
    .page-template-bare-page-php .singular.page .hentry {
    padding: 0;
    }

    /* Works */
    .singular.page .hentry {
    padding: 0;
    }

    I'd appreciate a pointer to the CSS selector subtlety I'm missing.
    Thanks.

  2. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

    please create a child theme http://codex.wordpress.org/Child_Themes to work with, instead of editing Twenty Eleven directly.
    it is vitally important to have an unedited default theme (which is Twenty Eleven for wp3.2) in case of problems; also, a child theme will help to keep customisations during an upgrade.

    can you post a link to your site?

    have you checked that the css classes are output on the pages using the page template?

Topic Closed

This topic has been closed to new replies.

About this Topic