• Tom

    (@rockstar_tom)


    Hello,

    I’ve created a new custom template ‘work_home.php’ based on the ‘page.php’ template. I want to change the css ONLY in ‘work_home.php’.

    I know you can target a specific template in my css like this:
    .home #container {border:red;}

    Any help is much appreciated ??

Viewing 1 replies (of 1 total)
  • If your theme uses the body_class():

    <body <?php body_class(); ?>>

    in header.php, you should find that any page that uses the work_home.php template should have a page-template-work_home-php class attached to the body element. You then use something like:

    .page-template-work_home-php #container {
    }

    to apply CSS to pages that use this template.

Viewing 1 replies (of 1 total)
  • The topic ‘Change CSS only on custom template page’ is closed to new replies.