最后我解决了这个问题:
<?php if (is_singular() ) : ?>
<?php foreach ($attributes as $attribute) : ?>
<h3><?php echo $woocommerce->attribute_label( $attribute[\'name\'] ); ?></h3>
<ul>
<li><?php $values = woocommerce_get_product_terms( $product->id, $attribute[\'name\'], \'names\' );
echo apply_filters( \'woocommerce_attribute\', wpautop( wptexturize( implode( \', \', $values ) ) ), $attribute, $values ); ?></li>
</ul>
<?php endforeach; ?>
<?php endif ?>