Function to display space separated (default) category slugs
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//* Function to display space separated (default) category slugs
function the_category_unlinked( $separator = ' ' ) {
$categories = get_the_category();
$thelist = '';
foreach( $categories as $category ) { // concatenate
$thelist .= $separator . $category->category_nicename;
}
echo $thelist;
}
<!-- Usage: -->
<div class="post<?php the_category_unlinked(' '); ?>">