• Hi

    I am using a woo theme called the Station. When I make a new page and add it to the top nav, I want to change the way the H2 behaves only on certain pages.

    I have this code to control the way the h2 behaves

    #page h2.title {
    margin: 0 0 25px;
    }

    And I thought if I could make a new div id:

    #page bulletpoint h2.title {
    margin: 0 0 25px 39px;
    }

    I would be able to place it into the page and control the way it works. So far no luck though. I am unsure who to modify the HTML. Is this a page template thing? Does it need a conditional statement?

    Thanks for any help.

Viewing 2 replies - 1 through 2 (of 2 total)
  • I would check to see if the theme already has page class classes included in the body tag for those pages. If so, you could make a CSS rule that applies only to those pages. (Go to the live version of the page(s) in question, look at the code, and see if the < body > tag has a bunch of words in class=”” after it. One of those is usually the page-slug, which helps to make targeted CSS rules).

    If the theme doesn’t have this in it, edit your page.php for that theme and make sure the body tag looks like this – <body <?php body_class($class); ?>>.

    HTH…

    Thread Starter Unconformed

    (@unconformed)

    Hi

    I fixed the problem anotherway (I reduced some padding on another element which fixed it). However I want to learn how to do it your way.

    I have this code in the body tag

    <body class="page page-id-38 page-parent page-template page-template-template-full-php logged-in admin-bar gecko">

    Which one is the slug, and what is the slug?

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘making custom divs for page templates’ is closed to new replies.