Created
January 18, 2015 19:22
-
-
Save shahadat014/9a94ecc433f2c42ad390 to your computer and use it in GitHub Desktop.
Show all tags sorting by the number of post
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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; | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment