if you are in the loop you can use get_post_taxonomies
like so:
$taxs = get_post_taxonomies($post->ID);
foreach ($taxs as $tax){
// $tax holds the taxonomy name so you can
//use either get_terms or get_terms_list
}
Update
I’ll try to explain better, since you don’t know what the post type is and you can’t tell what taxonomies are associated with that type you first get the list of taxonomies that are associated with each post (no matter what the post type is) like so:
$taxs = get_post_taxonomies($post->ID);
now $taxs is an array that holds the names of the taxonomies associated with the current post in the loop. so we can run a foreach loop to output the post specific terms for each taxonomy using get_terms or get_terms_list for example:
$taxs = get_post_taxonomies($post->ID);
foreach ($taxs as $tax){
$before = $tax . ": ";
echo get_the_term_list( $post->ID, $tax, $before, ' ', '' );
}
update 2
Well if you don’t wont it to echo post_tags then just check and skip it and as for getting just the terms and not the formatted html use wp_get_object_terms
instead of get_the_term_list
so something like:
$taxs = get_post_taxonomies($post->ID);
foreach ($taxs as $tax){
if (!$tax = "post_tags"){ //exclude tags
print_r(wp_get_object_terms( $post->ID, $tax)); // its an array of the terms
}
}