• Hi, basically what I want to do is change the theme depending on my current category. I’m thinking of something like:

    if (in_category('cars')) {
      "change theme to cars"
    }

    but I don’t know how to actually change the theme using php. Can anybody help me with this?

Viewing 6 replies - 1 through 6 (of 6 total)
  • You can use the category-{slug}.php

    http://codex.ww.wp.xz.cn/Category_Templates

    Thread Starter NeoNightCrawler

    (@neonightcrawler)

    But by using the category-{slug}.php I can only change the formating and other stuff in the category. I want my WordPress to actually load a new visual theme like changing the css.

    Or is there a way to do that with the category-{slug}.php that I don’t know of?

    Have you thought about using

    body <?php if(in_category("cars")) : echo "id=\"cars\""; endif; ?>

    That way you can have the style.css body#cars be different from body#me and body.

    Just a thought.

    Thread Starter NeoNightCrawler

    (@neonightcrawler)

    Yeah but I can’t only change the css, I must change all of the php files that make up the theme also. For example my default theme is “twentyten” which is in the path *public_html*/wp-content/themes/twentyten and I want to change to the theme that is in *public_html*/wp-content/themes/cars.

    I found a plug-in that creates a widget with a menu that lets me change the theme, but it was a bit complicated to understand so I don’t know what part actually makes the theme change.

    I think you’re making it more complicated than you need to…or what you want to do is going to require some handcoding.

    Thread Starter NeoNightCrawler

    (@neonightcrawler)

    I found out that the plug-in I was talking about sends this variable in my browser: my_wordpress_site_name.com/?wpthemes=cars

    Is it possible for my to send the wpthemes=cars variable with php?

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

The topic ‘Changing Themes Depending On Category’ is closed to new replies.