Site logo

Archived topic

Adding custom class to entry-content?

3 replies · Started by Wayne on March 17, 2016

Viewing posts 1–4 of 4

Hello! How can I add add a custom class to entry-content? I have added some custom CSS to style interior pages with a little pop of color and shadow. The problem is, this is also showing up on the home page of the site. The home page is just a standard page using Beaver Builder for the rows (Not my choice, I inherited this project, lol) but that should not matter right?

How can I target that specific page to not show my custom CSS with GeneratePress? Here is my CSS I am using:

div.entry-content {
background: #fff;
padding: 22px 20px 30px;
margin-bottom: 43px !important;
border-top: 4px solid #F0B400;
-webkit-box-shadow: 0 1px 5px 0 rgba(0,0,0,0.14);
-moz-box-shadow: 0 1px 5px 0 rgba(0,0,0,0.14);
box-shadow: 0 1px 5px 0 rgba(0,0,0,0.14);
}

If the homepage is the only page you don't want that CSS to apply to, you can do this:

body:not(.home) div.entry-content {
    background: #fff;
    padding: 22px 20px 30px;
    margin-bottom: 43px !important;
    border-top: 4px solid #F0B400;
    -webkit-box-shadow: 0 1px 5px 0 rgba(0,0,0,0.14);
    -moz-box-shadow: 0 1px 5px 0 rgba(0,0,0,0.14);
    box-shadow: 0 1px 5px 0 rgba(0,0,0,0.14);
}

Dang, learn something new everyday! Works fantastic. Thanks homie! Marking as resolved.

You're welcome!

This archived topic is closed to new replies.