• I have a test site set up at happygolucky.splashyphoto.com and I’m using the Thinn theme template from Themeforest. Their support staff has gone MIA so I’d really appreciate some help.

    I’ve added some custom CSS to change the height of the posts shown on the homepage (and haven’t updated the photos yet, so they look squished right now) but I cannot figure out how to add custom CSS to change the background colors of different posts.

    I’m familiar with editing the stylesheet, but I don’t know how to add a div class if I need to. Can someone please spell out how I would add the rules and where? Specifically which php file too, please.

    I’m guessing the simplest way would be to designate background colors for post categories?

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Ayman

    (@aymanalzarrad)

    Themes support here is only for themes hosted on www.remarpro.com and is not provided to commercial themes.

    Anyway, I can tell you that adding a div class or id should be done on the opening tag of the div so it is made this way:

    <div class="class-name"><!--Div Starts here-->
    </div><!--Div Ends here-->

    Than in the stylesheet you can target the div class this way:

    .class-name{
     /* Styles goes here */
    }

    Commercial themes really aren’t supported here, but you can generally use the post specific class which is in the generated HTML – for example on the home page, the first one is:

    <article class="post-996 post type-post status-publish format-standard hentry category-home clearfix sixteen columns odd">

    So you could add to CSS:

    article.post-996 {
        background-color: red;
    }

    Hopefully that will do what you want.

    I’d also recommend using Firebug to work with CSS and this is a good reference site : https://www.w3schools.com/css/default.asp

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Change rule for post background color in theme’ is closed to new replies.