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