How to retrieve categories name or Id for avatar purposes
-
I have excerpts of my posts instead of complete posts at my homepage.. I want to add a avatar next to them indicating the proper category.
I created a folder with the pictures. The pictures are named as the categories ID.
I added this to my index.php
<img src=”http://site.com/wp-content/avatars/<?php get_cat_name( $cat_id ) ?>.jpg”/>
I tried with “the_category” and get_the_category and nothing seems to work. How can I call the proper category to use it to call my images?
- The topic ‘How to retrieve categories name or Id for avatar purposes’ is closed to new replies.