这是脚本
$category_id = $cat->ID; /* <-- can get the id */
$getsubs = "SELECT term_id FROM wp_term_taxonomy
WHERE taxonomy = 'wpsc_product_category' AND parent = '".$category_id."'
ORDER BY term_id ASC";
$subcats = mysql_query($getsubs);
$num_rows = mysql_num_rows($subcats);
wpsc_start_category_query(array('parent_category_id'=>$category_id, 'show_thumbnails'=> 1)); ?>
<li>
<a href="<?php wpsc_print_category_url();?>" title="<?php wpsc_print_category_name();?>">
<?php wpsc_print_category_image(); ?>
<?php //wpsc_print_category_name();?>
<?php //wpsc_print_category_name();?>
</a>
</li>
<?php wpsc_end_category_query(); ?>
<div style="clear:both;"></div>
我是否正确使用它$cat->ID
。请帮忙。