Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #543912

    Hi,
    Thanks again for a great theme.
    I’m trying to create different title container backgrounds for different page templates.

    simple css is
    .title_container {
    background-color: #3F0;
    }
    How can I apply this to only pages assigned my new ” template-sport.php ”

    I’m guessing this is simple but its driving me nuts..

    Regards
    Evan

    #543960

    Hi adlinedesign!

    Edit the template and add this inside.

    <style type = "text/css">
    .title_container {
    background-color: #3F0 !important;
    }
    </style>

    Regards,
    Elliott

    #546226

    Hi Elliott
    Maybe I’m missing something simple or I haven’t made myself clear.
    In my child theme I’ve got template-sport.php & template-art.php (copies of template-builder.php with /*Template Name: Sport Template*/ …etc).
    What I’m trying to do is different title_container background for each template.

    With only style.css to work with i’m not sure where I have to put the above styling to only affect the template-sport pages.

    I hope that makes sense.

    cheers
    Evan

    #546294

    Hi,

    You could try adding the styling to the template itself, that should only affect the page using it. If not then please link to the site in question so that we can take a closer look.

    Thanks,
    Rikard

    #569036

    Hi Elliot,
    Thanks for your help. I’ve solved this and it’s fairly simple.

    Created template sport.php.
    The css to change h1 (or other elements) on pages using this template would be
    .page-template-sport-php h1{
    color: #666666!important;
    }

    Got myself confused by naming the template “sport-template.php”
    which meant the css should have been “.page-template-template-sport-php”

    thanks again for great support

    Evan

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘CSS styles for different page templates.’ is closed to new replies.