WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Editing theme to make category background colour change (7 posts)

  1. neverenoughnotes
    Member
    Posted 3 years ago #

    Thought I'd ask about this before I broke my site!

    In the following category, I want the background to be a different colour:

    http://www.neverenoughnotes.co.uk/wordpress/category/allsaints/

    I also want it on each post's background - I tried looking at templates and things but I can't seem to understand it. I use Arthemia as a theme which is probably making things worse, I can't see <body class> anywhere.

    I added the following to my style.css and nothing happened:

    body.category-3312 {
    	background:#303030;
    	}

    Have been reading around all day and found nothing that could help so hope someone can shed some light.
    Also, a link where I could learn more about this would be lovely! I'd love to be able to come back and help others more.
    Thanks :)

  2. You're missing the code that assigns a unique class to the body. Look in your header.php and replace

    <body>

    with

    <body <?php body_class(); ?>>

    Read more here:

    http://codex.wordpress.org/Function_Reference/body_class

    http://wpmu.org/how-to-use-the-body-class-tag-to-apply-custom-styles-to-wordpress-pages/

    Let me know if you have any further questions after taking a look at that.

  3. neverenoughnotes
    Member
    Posted 3 years ago #

    Thanks so much for that, still not working :(

  4. neverenoughnotes
    Member
    Posted 3 years ago #

    aha! its worked, but now that article is all left-aligned and it's screwed up the layout #tootiredforthis

  5. neverenoughnotes
    Member
    Posted 3 years ago #

    and my cuteprofiles plugin doesnt work on this page either, the images vanish when highlighted

  6. Glad you got the body classes working. Just adding a background colour should not have affected things like alignment, layout, or plug-in functionality, though. Could you start a new thread for these different issues, if they're still giving you trouble?

  7. neverenoughnotes
    Member
    Posted 3 years ago #

    thanks, will do :) think its a theme issue

Topic Closed

This topic has been closed to new replies.

About this Topic