Category Image
-
For the category archive page I have 2 things
1) an image for the category
the images for all my categories are in a singple directory on my website, and each image is named after the category name (nicename).
So, on archive.php, i call the category image with :
<?php foreach((get_the_category()) as $category) { echo '<img src="http://mydomain.com/images/category/' . $category->category_nicename . '.jpg" /> '; } ?>
I also have category descriptions for each category, which are shown in the archive.php
I call the description with :
<?php echo category_description( $category ); ?>
problem is, description won’t show up when the image calling code is enabled. But as soon as i remove the category image code, the description shows up in the archive.php
any fix ?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Category Image’ is closed to new replies.