Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

How would I display HTML conditional on a particular category page?

Say my permalinks to the category pages are

http://www.mysite.com/category/awesome-category

How would I cast the <?php if ... ?> to do this, and within what template of my theme?

I'm using WP 3.3.1. If I need to provide more information I'll be happy to. Thanks!

share|improve this question

1 Answer 1

up vote 3 down vote accepted
if(is_category('awesome-category')) echo "whoa awesome category here!!;

probably in category.php, but it really depends on the setup of your theme... if you are using a child theme, etc. also you could create a special template just for that specific category.

category-awesome-category.php

see: http://codex.wordpress.org/Template_Hierarchy

share|improve this answer
    
possible category template name: category-awesome-category.php - codex.wordpress.org/Category_Templates –  Michael Feb 24 '12 at 13:57
    
you're right. fixed. –  helgatheviking Feb 24 '12 at 15:22

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.