Showing category image with title and description
-
I have a page that lists the title of each category and its description. I downloaded the Taxonomy Images plugin so I could also include each category’s featured image, but I’m unsure how to add it to my page.
Here’s the goal:
<figure> <img src="category image" /> <figcaption> category title and description </figcaption> </figure>
And here’s the code I have so far:
<?php $categories = get_categories(); foreach ($categories as $cat) { echo "<figure><a href=\"" . get_category_link( $cat->term_id ) . "\">" . $cat->cat_name ."</a>"; echo "<figcaption>". $cat->description ."</figcaption></figure>"; } ?>
Anybody know what to do to insert the image?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Showing category image with title and description’ is closed to new replies.