Created
July 6, 2012 23:14
-
-
Save reediredale/3063326 to your computer and use it in GitHub Desktop.
Category without parent or links
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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