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

I have this code:

<div class=”row”>
<div class=”col-lg-12 post_meta”>
<ul>
<li>
<p class=”meta-txt”>Category</p>
<p class=”meta-des”><?php $category = get_the_category(); echo $category[0]-> cat_name; ?></p></li>
<li>
<p class=”meta-txt”>Published</p>
<p class=”meta-des”><?php the_time(‘F j, Y’); ?> </p></li>
<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>
</ul>
</div>
</div>

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

http://www.migrate2.deniz-tasarim.site/2020/01/10/yazi-9/

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 *