• Resolved bootsmaat

    (@bootsmaat)


    Is there a way to apply specific CSS to a post displayed in single.php? I do not mean assigning a CSS file to it but to be able to modify CSS properties of the page from within a post.

    For example, lets say I’d like to have a different page background color for every post. How can I modify the CSS property background-color: of the <body> tag?

    Is there a plugin to do this? If not, how could I hack my template to do this?

    I played around with the wp_head() hook in the <head> tag of the page but I can’t seem to insert any additional CSS by this means because when the Loop is run header.php has already been executed.

    Any suggestions?

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

The topic ‘Custom CSS for any post’ is closed to new replies.