Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php $parentscategory ="";
- foreach((get_the_category()) as $category) {
- if ($category->category_parent == 0) {
- $parentscategory .= ' <a href="' . get_category_link($category->cat_ID) . '" title="' . $category->name . '">' . $category->name . '</a>, ';
- }
- }
- echo substr($parentscategory,0,-2); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement