This code makes use of Taxonomy Photographs plugin to show photos for classes. This code show subcategories of most important class in dad or mum class web page (class.php
), However I wish to show just one degree of subcategory within the web page for instance
{hardware} (dad or mum class)
-
monitor (first degree subcategory of harware)
-
samsung (second degree subcategory)
- liquid crystal display (third degree subcategory )
-
When the consumer clicks on the {hardware} hyperlink, he ought to see solely monitor subcategory hyperlink and in second time when he clicks on the monitor, he ought to see the samsung class hyperlink, and when he click on on the samsung the subcategory LCD will shows.
How ought to I modify this code to do my phrase
My code:
<?php
$cat_id = get_query_var('cat');
$catlist = get_categories('hide_empty=0&child_of=' . $cat_id);
echo "<ul>";
foreach($catlist as $categories_item)
{
echo '<h1><a href="' . get_category_link( $categories_item->term_id ) . '" title="' . sprintf( __( "View all merchandise in %s" ), $categories_item->title ) . '" ' . '>' . $categories_item->title.'</a> </h1> ';
echo '<div class="categoryoverview clearfix">';
$phrases = apply_filters( 'taxonomy-images-get-terms', '' );
if ( ! empty( $phrases ) ) {
foreach( (array) $phrases as $time period ) {
if($term->term_id == $categories_item->term_id) {
print '<a href="' . esc_url( get_term_link( $time period, $term->taxonomy ) ) . '">' . wp_get_attachment_image( $term->image_id, 'thumbnail' );
echo '</a>';
}
}
echo '<p>'. $categories_item->description; echo '</p>';
}
echo '</div>';
}
echo "</ul>";
?>