echo $category[0]-> cat_name; shows only one category name

I have this code:

<div class=”row”>
<div class=”col-lg-12 post_meta”>
<p class=”meta-txt”>Category</p>
<p class=”meta-des”><?php $category = get_the_category(); echo $category[0]-> cat_name; ?></p></li>
<p class=”meta-txt”>Published</p>
<p class=”meta-des”><?php the_time(‘F j, Y’); ?> </p></li>
<p class=”meta-txt”><?php echo get_comments_number(); ?> Comments</p>
<p class=”meta-des”><?php if (comments_open( get_the_ID() ) ) comments_popup_link( __( ‘Leave your thoughts’, ‘html5blank’ ), __( ‘1 Comment’, ‘html5blank’ ), __( ‘% Comments’, ‘html5blank’ )); ?></p></li>

It shows only one category as you can see on that link:

Also I want to show tags as list and link to categories and tags.How can I do it?

Read more here:: cat_name; shows only one category name” rel=nofollow>echo $category[0]-> cat_name; shows only one category name

Leave a Reply

Your email address will not be published. Required fields are marked *