WordPress.org

Forums

Styles
[resolved] Style single post/page in theme (3 posts)

  1. dim
    Member
    Posted 10 months ago #

    Hi, i am using your plugin to customize my home page for a custom theme and so far it works great.I cannot make it work though for pages like single-page.php , i tried the body classes css to specify the rule but i think it does not respect it.

    could you help?

    example

    .single .post { background:etc..}

    https://wordpress.org/plugins/styles/

  2. Paul Clark
    Member
    Plugin Author

    Posted 10 months ago #

    I'm a bit clear on how you're trying to make that edit. Are you attempting to add new options by editing customize.json in your own plugin or theme?

    If so, your approach of using the .single body class to target elements on the single page is correct. If you don't see a change take effect, verify that the CSS selector is correct, and verify that other CSS rules are not conflicting with or overriding your custom one. For example, the computed side panel in Firebug will tell you all styles assigned to an element, and whether some selectors are overriding others.

    CSS selectors aren't only applied in the order they're declared -- they also apply in order of selector specificity. IDs carry much more weight than classes, which carry more weight than tags. For example, see http://css-tricks.com/specifics-on-css-specificity/ .

    If all else fails, custom selectors can also have !important applied by setting "important": true in the JSON.

  3. dim
    Member
    Posted 10 months ago #

    i ll try it again, i tried many combination and i have a 'basic' knowledge of css , in my tests any body class i tried was not working, but since you know better i will try again.

    Thanks for the reply.

    ps.amazing plugin.

Reply

You must log in to post.

About this Plugin

About this Topic

Tags