Skip to content

Instantly share code, notes, and snippets.

@reediredale
Created July 6, 2012 23:14
Show Gist options
  • Save reediredale/3063326 to your computer and use it in GitHub Desktop.
Save reediredale/3063326 to your computer and use it in GitHub Desktop.
Category without parent or links
<?php $categories = get_the_category();
$temp = array();
foreach($categories as $category) {
if ($category->category_parent == 0) continue;
$temp[] = str_replace('-', '', $category->name);
}
echo implode(", ", $temp);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment