Add catagory images to list of catagories
-
Hello,
I have been using the plug in for a travel site and would like to list the child categories in the the parent category. I have been able to pull the title and description but are having issues getting the thumbnail. Currently i get the featured image of the page that I am on not of the category.
Any help would be appreciated thanks.
Here is my code:
`<?php
$this_cat = get_query_var(‘cat’);
$args = array(
‘orderby’ => ‘name’,
‘order’ => ‘ASC’,
‘parent’ => $this_cat
);
$categories = get_categories($args);
foreach($categories as $category) {
echo get_the_post_thumbnail( $category->ID, ‘thumbnail’ );
echo ‘<p><a>term_id ) . ‘” title=”‘ . sprintf( __( “View all posts in %s” ), $category->name ) . ‘” ‘ . ‘>’ . $category->name.'</a> </p> ‘;
echo ‘<p> Description:’. $category->description . ‘</p>’;
}
?>`https://www.ads-software.com/plugins/enhanced-category-pages/
- The topic ‘Add catagory images to list of catagories’ is closed to new replies.