I tried the thingy at https://codex.www.ads-software.com/Template_Tags/get_the_category#Show_Category_Images
I put the following code in my index.php file in front of <?php the_title(); ?> … but nothing happened:
<?php foreach((get_the_category()) as $cat)
{ echo ‘<img src=”https://example.com/images/’ . $cat->cat_ID . ‘.jpg”
alt=”‘ . $cat->cat_name . ‘” />’; } ?>
The image is exactly named like the category.
Any additional explanation on how to use the code on the page mentioned above!? Please?
Eric
Edit:
DUH!!!! Ok found the flaw in my try! Picture name should be the number of the category (ID) not the name! It works!