How to show Show all tags sorting by the number of post
Hi, Today i will teach you How to show Show all tags sorting by the number of post,
<?php $tags = get_terms( array("post_tag"), array("orderby"=>"count","order"=>"DESC")); if ( !empty( $tags ) && !is_wp_error( $tags ) ) : echo '<ul>'; foreach ( $tags as $tag ) : echo '<li>' . $tag->name . '(' . $tag->count . ')</li>'; endforeach; echo '</ul>'; endif; ?>
Thanks for read this article, you can share this post if you think this helpfully post.
You have to enjoy this articel? Don't forget subscribes this site.
If you want to get our update article, then please subscribe this site.