Background colour on single posts

Community Forums Forums General Discussion Background colour on single posts

This topic is: not resolved

Tagged: , , ,

This topic contains 5 replies, has 3 voices, and was last updated by  deejuk 10 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #69746

    deejuk
    Member
    Post count: 12

    Hi all

    Hope someone can help with this.

    I have been able to style up custom pages fine. And even added styling to a category no problem using the css

    .category-9 .site-container {
    background: blue;
    }

    However I have read the wordpress codex and it states that the styling for the category should be inherited by the single posts in that category. But no.

    I have tried always. to change the .site-container element for a single post to no avail.

    Can anyone please help me resolve this .. I have tried it on another Genesis site of mine and it does the same thing…fails to inherit the category styling.

    http://#local
    #69753

    nutsandbolts
    Moderator
    Post count: 3119

    Here’s a plugin that would probably make it easy to do what you want to do: http://www.wphub.com/wp-post-styling-wordpress-plugin/

    If you don’t want to use a plugin, you would probably have to target each post individually by its ID, though you could list all IDs from a particular category together and set one CSS rule.


    Andrea Whitmer, Owner, Nuts and Bolts Media
    I provide dev and training services for web designers • Find me on Twitter and Google+

    #69761

    deejuk
    Member
    Post count: 12

    Thank you for that I feared it would be a plugin or listing posts individually. It’s genesis I am using by the way

    #69952

    deejuk
    Member
    Post count: 12

    For the record on this I am using Cobolt Dynamik to achieve this. You can set a label in Dynamik and then add CSS directly in a CSS hook. When you edit the post you can then select the label with the styling on and it applies it to just that post.

    It seems single posts don’t inherit the category styling for some reason, but this is a decent work around if you either have Dynamik or know conditional hooks etc.

    #69977

    olivier.moreau
    Participant
    Post count: 48

    It’s not clean or recommended but you could simply put your CSS right into the content of the post (inline CSS).
    In the text editor put :
    <div style=”background-color:blue;”> your text </div>

    #69981

    deejuk
    Member
    Post count: 12

    Thank you for the reply .. it does work thank you.

    Shame it simply won’t pick up the category styling but hey

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

You must be logged in to reply to this topic.