解决了:
<?php
GLOBAL $wpdb;
$query = "
SELECT
terms.slug, r.term_taxonomy_id, terms.name AS cat_name
FROM
{$wpdb->prefix}term_taxonomy t, {$wpdb->prefix}terms terms, $wpdb->posts p, $wpdb->term_relationships r
WHERE
t.term_id=terms.term_id AND
p.ID = r.object_id AND
r.term_taxonomy_id = t.term_taxonomy_id AND
p.ID = '".$post->ID."'
ORDER BY terms.term_order ASC, terms.term_id DESC";
$categories = $wpdb->get_results($query, ARRAY_A);
if(is_array($categories)){
$i=1;
foreach($categories as $category) {
echo '<span>'.$category['cat_name'].'</span>';
++$i;
}#end foreach($categories
}#end if
?>