Subcategory thumbnails within parent category
-
Hey everyone.
I’m using the Categories Images plugin to try and show a thumbnail and a link to subcategories within any parent category page.
I have created a child theme and am editing in the archive.php file within the child theme and I have this but it doesn’t produce any results (the image part).
This is my code so far:
<?php $cat = get_category( get_query_var( 'cat' ) ); $cat_id = $cat->cat_ID; $child_categories=get_categories( array( 'parent' => $cat_id ) ); ?> <ul> <?php foreach ( $child_categories as $child ) { // Here I'm showing as a list... echo '<li>'; ?> <img src="<?php echo z_taxonomy_image_url($cat->term_id); ?>" /> <?php echo '<a href="/'.$child ->slug.'">'.$child ->cat_name.'</a>'; echo '</li>'; } ?> </ul> </div>And this is the documentation for the Categories Images plugin:
http://zahlan.net/blog/2012/06/categories-images/
I hope someone can show me the errors of my ways?
Thanks!
The page I need help with: [log in to see the link]
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
The topic ‘Subcategory thumbnails within parent category’ is closed to new replies.