Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $category = get_the_category(get_the_ID());
- if($category[0]){
- echo '<a href="'.get_category_link($category[0]->term_id ).'" class="category-'.$category[0]->slug.'">'.$category[0]->cat_name.'</a>';
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement