Add image to category on blog entries
-
Hi there,
I created a page where several posts of different categories are displayed. To distinguish them more easily I wanted to add an image to each category.
So every post of category 1 should get a certain image, and every post of category 2 a different one.Important: I’m not talking about the single.php pages, I’d like to add the images to every blog entry in index.php.
Does anyone got a clue how to do this? I’m new to php and tried my best, but I’ve got absolutly no idea.
Thanks in advance!
Edit:
I think it would be fine if I knew how to write a loop that checks for the category of each post and then echos a certain image. Something like
if (is category News) {
echo image }
…
Would something like that be possible?
- The topic ‘Add image to category on blog entries’ is closed to new replies.