<?php
$cats ='';
$categories = get_categories( );
$rand_keys = array_rand($categories, 12);
foreach ($rand_keys as $key) {
$cats .= $categories[$key]->term_id .',';
}
wp_list_categories('title_li=&hierarchical=0&hide_empty=0&show_count=1&include='.$cats);
?>