Custom css for posts only

Do you know a plugin that enable the option the make custom css that will work only on posts and not pages and other options like this ?

  • Bojan Radonic

    Hey Ofir,

    How are you doing today?

    I haven't heard for plugins that would allow you to do that but in most of the themes you can simply target classes that are specific for single post pages and in that way avoid having that CSS affecting anything else so I wouldn't recommend installing such plugin even if there would be one.

    All you have to do is use developer tools to check the class in body element on single post pages, you can find more info about using developer tools (ie Chrome) here: https://developer.chrome.com/devtools.

    Just look for the body element that should be close to the top of inspector and check for classes inside there, see screenshot:

    So lets say you want to change the size of the titles on the single post pages only, based on the class from my example above it should look like this:

    .single-post h1.entry-title {
        font-size: 15px;
    }

    By adding ".single-post" in your selector you're going to target only h1 titles on your single post pages if that makes sense.

    Hope this helps and if you have any questions please let me know :slight_smile: Also if you want me to check this on your site I can definitely do that as well, I'll just need link to your site, to one of those blog posts :slight_smile:

    Cheers,
    Bojan

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.