Does anyone know what php code I would use to perform an action such as:
if the post category is XX then display post excerpt, if in any other category then display the full content?
I've looked through the codex and it seems I can test the category in the loop ie:
<?php
if ( in_category( 'pachoderms' )) {
// They have long trunks...
} elseif ( in_category( array( 'Tropical Birds', 'small-mammals' ) )) {
// They are warm-blooded...
} else {
// & c.
}
?>
Would it be:
<?php
if ( in_category( 'pachoderms' )) {
<?php the_excerpt ?>
} else {
<?php the_content ?>
}
?>
I'm not very good with syntax, so could someone look this over to see if that's how it would be done, please? Thanks!