Is there any way through Custom CSS to change the body text for one particular page

Comments

3 comments

  • Marty Thornley

    Hey Paul,

    If you are familiar with something like Chrome's developer tools or Firebug, you can look into the code to get more specific.

    Each page in WordPress has a unique ID, which gets attached to the overall "body" of the page. So you can target specific pages.

    The format of the tag ends up looking like this:

    <body class="page page-id-34 page-template-blogpage.php">

    And so on. There will be lots of classes in there. The one you want is the "page-id-34" where 34 would be the ID of the page.

    If you do not know how to find that, look at the list of pages in the admin and you will find it there. You can also edit the page and look at the url at the top, where you see something like "post=34" which will give you the id as well.

    Then within the CSS, just add the following and replace your page id:

    body.page-id-34 p { color: #000000; }

    I used p for all paragraphs but you could also do all elements or any that you want to be specific about.

    Hope that helps!

  • Marty Thornley

    Hey Paul,

    Not sure where you go that page-id-3 from but that is not the id of that page. :)

    The other trick is that you are actually targeting blog posts, within a page. It sounds like maybe the whole blog section should have the smaller titles?

    Try this:

    body.is-blog-page h2 a { font-size: 50px; }

    Also, that text seems a bit chopped off. Try adding a line-height to fix:

    body.is-blog-page h2 a { font-size: 50px; line-height1em; }

Please sign in to leave a comment.

Powered by Zendesk