Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialArgzon Haziraj
Courses Plus Student 14,994 PointsWhat about different header styles for different categories ?
How can we make it different header styles for different categories ?
P.S. i saw it and it makes me curious
1 Answer
Muhammad Mohsen
Courses Plus Student 10,843 PointsHi Argzon,
You can use is_category() to determine which category your viewing now and change whatever you want depend on that
<?php
/*
* Parameters: Category ID, Category Title, Category Slug or Array of IDs, names, and slugs.
*/
if( is_category('News') ) {
// do something
// this check may go anywhere in you project, header, footer, single, etc.
}