New Landing How can we help? Themeforest Theme Support Neighborhood Change page colors including header color based on category

Viewing 11 posts - 1 through 11 (of 11 total)
  • #248063
    Ben Urban
    Member
    Post count: 24

    Can I change the header colors (and other colors) to match specific categories? My site needs a color for the general pages (about, contact, blog) and then a different header color for the ACHLA portion and a different color for the minuteman section.

    Is this possible?

    thanks,
    -ellen

    #248649
    David Martin – Support
    Moderator
    Post count: 20834

    Hi Ellen,

    This is not possible to do via any options.

    WordPress does add a unique body class to each page, so you could use that to alter the colors with CSS.

    For example, this page: http://emmgraphics.com/projects/achla/ has a unique body class of page-id-2. Using that you can change the header color:

    .page-id-2 #header-section {
        background-color: red;
    }

    Thanks.

    #248777
    Ben Urban
    Member
    Post count: 24

    Thank you. I was hoping for a more global solution since this would require a me to put an id for every page in the site. Do you have any code solutions that I could add to my functions page to detect categories and maybe an another class to the body tag or change the template?

    #248787
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    Hi

    You can add the category class instead of the page id

    – Kyle

    #248793
    Ben Urban
    Member
    Post count: 24

    Thanks, I will try that.

    #248794
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    No problem

    #250062
    Ben Urban
    Member
    Post count: 24

    I’ve tried your idea but the theme writes inline styles. How can I override them in my child theme? Can I turn off the code that writes the css for specific elements and then add my own? I need to do it for different categories.

    thanks,
    -ellen

    #250066
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    If you’re over writing the theme colours in the child theme style.css file you will need to add !important

    – Kyle

    #250086
    Ben Urban
    Member
    Post count: 24

    Adding important! to the child-css will not overwrite the inline styles. Those are being added by the Theme options which are being written inline.

    #250091
    Ben Urban
    Member
    Post count: 24

    Update. I believe this can be done but is not practical. Every page would need to get added to the css file since there isn’t a category class that I can find.

    #250230
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    It has to be an actual category page like this:

    http://emmgraphics.com/projects/achla/product-category/achla-designs/

    Category id is term-20

    – Kyle

Viewing 11 posts - 1 through 11 (of 11 total)

You must be logged in to reply to this topic.