ThemeShaper Forums » Thematic

Change body class

(6 posts)
  • Started 12 years ago by gelay
  • Latest reply from matthanson
  • This topic is resolved
  1. How can I change body class from "wordpress" to xxxx using functions.php?

    Posted 12 years ago #
  2. Hey,

    try this one:

    function repl_wp($bc) {
    return str_replace('wordpress', 'whatever', $bc);



    Posted 12 years ago #
  3. Hi Chris, Is it possible to change body class according to category within functions? (Want a simple way to change the background colour of the page depending on category.)

    Posted 12 years ago #
  4. Hey Matt,

    there's no need to change anything except of your style.css :-)

    Try this one:

    body.s-category-YourCategory {background:red;}

    This will display a red background on all single pages with a post listed in category YourCategory.



    Posted 12 years ago #
  5. Works!!! Thanks Chris.

    Posted 12 years ago #
  6. Chris, thats perfect. Thanks!

    Posted 12 years ago #

RSS feed for this topic


You must log in to post.