Displaying sub-category images
-
I’m using the categories-images plugin and am trying to display the sub categories of a particular category.
I don’t want to display the posts, just the sub category title, description and image.
Here’s what I’ve got so far:
<?php $args = array('child_of' => 67); $categories = get_categories( $args ); foreach($categories as $category) { echo '<li>'; the_post_thumbnail(); echo '<div class="post-details-wrapper">'; echo '<h3><a href="' . get_category_link( $category->term_id ) . '" title="' . sprintf( __( "View all posts in %s" ), $category->name ) . '" ' . '>' . $category->name.'</a> </h3> '; echo '<p>'. $category->description . '</p>'; echo '</div>'; echo '</li>'; } ?>Rather than displaying the featured-image of each sub-category being listed, all I’m getting is the same image from one particular post(not even the main parent category image). Even though I’m not showing any posts on the page, only categories.
Any ideas?
Thanks
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘Displaying sub-category images’ is closed to new replies.