why is the closing curly bracket here?
-
I’m trying to figure out how to display the latest instance in each of 3 categories on the index page, am not getting answers to my questions here, and am slowly stumbling my way through the Codex, and now have a question about one of the examples.
<?php if (is_category('11') ): // we're in the Plants category, so show a plant ?> <img src='/images/plant.png' alt='a plant' /> <?php } elseif (is_category('22') ): // we're in the Flowers category, so show a flower ?> <img src='/images/flower.png' alt='a pretty flower' /> <?php endif; // end the if, no images for other other categories ?>
Line 4 has a closing curly bracket that prompts an error when I put the snippet in my index template.
Why is the closing curly bracket there?
What does it do?I took it out, the error goes away, I seem to have fixed a subsidiary problem, and might then be able to get back to my main question.
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘why is the closing curly bracket here?’ is closed to new replies.