Show all categories, rather than the ones the post is assigned
-
Hi,
I have the following code below that shows just the categories that the current post is assigned to,
I need a way of showing all the categories on the blog.
<div class="categories-title">Tags</div> <div class="categories"> <?php $categories = get_the_category(); $separator = ' '; $output = ''; if($categories){ foreach($categories as $category) { $output .= '<p>'.$category->cat_name.'</p>'.$separator; } echo trim($output, $separator); } ?> </div> </div>
Any help is appreciated
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Show all categories, rather than the ones the post is assigned’ is closed to new replies.