• Hi guys,

    I need to edit .entry-content td, .comment-content td for a single page on my site. Searching tells me that an option is to duplicate an existing page.php and css file. This is a lot of duplicate code for not a big change, so I’m wondering if there’s a better option.

    Any help much appreciated!

    Mark

Viewing 4 replies - 1 through 4 (of 4 total)
  • what theme are you using?

    do you need to change the formatting or the html structure?

    does the theme use body_class() in the body tag?

    http://codex.wordpress.org/Forum_Welcome#Include_as_much_information_as_possible

    Thread Starter mk2mark

    (@mk2mark)

    Hi,

    Sorry about the lack of info.

    To answer your questions I am using the Attitude theme by theme horse, I am trying to change formatting on a table, and yes the theme uses body_class() in the body tag.

    Thanks.

    and yes the theme uses body_class() in the body tag.

    There’s your answer, then. If you inspect the body tag for the page that you want to modify, you’ll see one of the classes has the format page-id-ID, where ID will be the unique number which identifies the page. So in your CSS, if 123 was the post ID for that page, all you need to do to target something just on that page is to add body.post-id-123 (or just .post-id-123) at the front of the CSS selector. For example, this:

    body.post-id-123 p {
       font-size: 14px;
    }

    would change the font size of all paragraph elements, but only on the post-id-123 page.

    Thread Starter mk2mark

    (@mk2mark)

    Thanks very much, it’s easy when you know how!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Change one line of css for single page’ is closed to new replies.