PHP Help
-
I dont know PHP and looked for the answer, but couldn’t find it. I am trying to create an if statement where it displays a certain image, unless I specify a different image for a certain category.
I have this:
<?php if (in_category('1') ): ?>
<img src='/images/teams.jpg' />
<?php elseif in_category('4') ): ?>
<img src='/images/child-sponsorship.jpg' />
<?php else: ?>
<img src='/images/home-image.jpg' />
<?php endif; ?>
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘PHP Help’ is closed to new replies.