Sign up ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

In my single.php file I would like to have a conditional that checks for the category of the post and display certain images and layout. Here is what I have:

share|improve this question

1 Answer 1

up vote 2 down vote accepted

Look at


<?php if ( in_category('rabbis-weekly-commentary') ) : ?>                   
<div id="inner_header">
<img src="" border="0">
<?php elseif ( in_category('yaels-weekly-commentary') ) : ?>                    
<div id="inner_header">
<img src="" border="0">
share|improve this answer

Your Answer


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.