How do i go about making the code only show one category?
<?php
$categories = get_the_category();
foreach($categories as $key => $category) {
$url = get_term_link((int)$category->term_id,'category');
$categories[$key] =
"<dt><h1>{$category->name}</h1> </dt>" .
"<dd>{$category->category_description}</dd>";
}
echo "<dl>\n" . implode("\n",$categories) . "\n</dl>";
?>
The Reason why am asking is that I have two category(s) on some of the posts but i only want to show one of them. Is there way to add it to the code above so it only shows one thanks.