category image
-
Hi,
I want to put a image instead text for category’s posts and I managed to do it with this:<?php
foreach((get_the_category()) as $category) {
echo ‘<img src=”http://example.com/images/’ . $category->cat_ID . ‘.jpg” alt=”‘ . $category->cat_name . ‘” />’;
}
?>but it shows a image for every category a post have.. the thing is I want to show only a image when a post have 2 or three categories..
for ex: if a post something in Movies -> Comedy -> Horror I want there to be only a image, the one for principal category (Movies), not three images..The blog I need help with is: (visible only to logged in users)
-
If you can post .php to your blog then you are using the wrong forum, and we can’t help you here. Please read this:
https://en.forums.wordpress.com/topic/please-read-me-first-before-posting?replies=1
and then go here:
- The topic ‘category image’ is closed to new replies.