Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #3740

    Hi,

    I`m using the light skin for my website. For just one category (gallery) I would love to change to the dark skin.

    I tried conditional tags and was able to change the background color for that one category but couldn`t figure it out how to switch the whole stylesheet.

    Can you help?

    Thanks in advance!

    #43552

    Hey,

    You could use a conditional tag in header.php to adjust the “skin” (or colour scheme) in use on a specific category.

    Change this:

    $skin = $k_option['general']['skin'] != '' ? $k_option['general']['skin'] : 1;

    to:

    if ( is_category('category-slug')) {
    $skin = 4;
    } else {
    $skin = $k_option['general']['skin'] != '' ? $k_option['general']['skin'] : 1;
    }

    You’ll need to update category-slug to the category slug of the gallery category and 4 to the number of the stylesheet you want to use (located in the CSS folder).

    e.g. To use /css/style3.css you’d change 4 to 3

    See the codex for a full list of conditional tags: http://codex.wordpress.org/Conditional_Tags

    Hope this helps!

    James

    #43553

    Hi James,

    great – thats exactly what I wanted!

    I still had to chance the conditional tags slightly and now it works like a charm.

    Thanks a lot,

    Thomas

    #43554

    Glad that James could help you :)

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

The topic ‘Change skin for category’ is closed to new replies.