Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- echo '<div class="post-categories">';
- $tax = 'category';
- $terms = get_the_terms($post->ID, $tax);
- if (!empty($terms)) :
- if (count($terms) === 1) {
- echo "<p>Category:</p>";
- } else {
- echo "<p>Categories:</p>";
- }
- echo '<ul class="nostyle">';
- foreach ($terms as $term) {
- echo '<li><a href="' . get_term_link($term->slug, $tax) . '">' . $term->name . '</a></li>';
- }
- echo '</ul>';
- endif;
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement