getting all tags and have some style in Worpress as below code.

I hope this code can help you.

<ul class="tag-ul"> 
<?php $tags = get_tags('post_tag'); 
if ( $tags ) : foreach ( $tags as $tag ) : ?> 
<li class="tag-list">
<a class="tag" href="<?php echo esc_url( get_tag_link( $tag->term_id ) ); ?>" title="<?php echo esc_attr( $tag->name ); ?>">
<?php echo esc_html( $tag->name ); ?>
</a>
</li> 
<?php endforeach; ?> <?php endif; ?> 
</ul>
.tag-list{
display:inline-block;
list-style-type:none;
padding:5px 10px;
margin-right:10px;
margin-bottom:10px;
border:1px solid #ccc;
border-radius:20px;
}

Share this Article !

You may like this