different style for categories

Home Forums Techozoic different style for categories

This topic contains 5 replies, has 2 voices, and was last updated by  larese 8 years, 1 month ago.

Viewing 6 posts - 1 through 6 (of 6 total)
Author Posts
Author Posts
November 27, 2009 at 12:28 am #557

larese

Hi, I like to know if it is possible to apply a different style to a single category of the site, where the main theme is techozoic.
In the category section i couldn’t find options in that sense, but may be working on php files there is a way to hack it.
The point is to have a different look and feel for a single category, tyhank you in advance for a reply
Luca Arese – Torino Italy

November 27, 2009 at 1:12 am #558

Jeremy Clark

It’s possible but there isn’t an option for it in Techozoic. What you’ll need to do is to copy the single.php and make a new php file named category-ID.php where ID is the ID of the category you want different. Then you’ll just need to edit the new file and change the way the page is laid out. Another possiblity is to include a different stylesheet for a different category. For that you’d need to use an if is_category in the header.php to include the other stylesheet for just that category.

Let me know if you need more help.

Resources: Category Templates
is_category tag

November 27, 2009 at 1:48 am #559

larese

Hi Jeremy,
Really appreciate your quick answer. May be the second solution is more polite, i’ll try this. I’m not a great phper, so please can you specific the code line number where can i put the hack, and may be the right syntax?
I guess it will be something like:

<?php
$pg_cat=”page_category_name”;
if (is_category(‘prospettiva09’)) {$pg_cat .=” /wpcontent/themes/techozoic-fluid/cat_theme.css”;}
?>

November 27, 2009 at 5:57 am #560

Jeremy Clark

In the header.php you can just add the following code right before the closing head tag.

<?php
if (is_category(‘prospettiva09’)) { ?>
<link rel="stylesheet" type="text/css" media="screen" href="<?php bloginfo(‘template_directory’) ?>/cat_theme.css" />
<?php } ?>

Putting this below the main stylesheet should override any styles. Certain options set in the control panel for the theme won’t be overwritten such as how many columns if sidebars should be shown on single pages.

Good luck

November 29, 2009 at 11:24 pm #561

larese

Hi Jeremy,
Got back to the office on monday and found your code lines, i’m so grateful and will try it immediately. I’ll let you know how it go!
Have a nice Day, luca

November 30, 2009 at 5:59 am #562

larese

With a little modifications, it work perfectly
I just had to change category name

<?php
if (is_category(‘prospettiva09′)) { ?>
in in category id
<?php
if (is_category(‘15′)) { ?>
I’ve also duplicate the rotate.php to rotate1.php to have the possibility to change also the header image settings.
Here you can see the result:
standard techozoic sheet:
http://www.labquazza.unito.it/blog/
different category style:
http://www.labquazza.unito.it/…..og/?cat=15
thank you again
luca

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

You must be logged in to reply to this topic.