This will output a list of all tags, sorted by the most used tag first. Each tag has the number of times it has been used following the tag in parentheses. The parentheses and number of times used is in a <span>
. To remove the parentheses, change <span>(' . $tag->count . ')</span>
to <span>' . $tag->count . '</span>
<ul id="tags-list">
<?php
$tags = get_tags( array('orderby' => 'count', 'order' => 'DESC', 'number'=>20) );
foreach ( (array) $tags as $tag ) {
echo '<li><a href="' . get_tag_link ($tag->term_id) . '" rel="tag">' . $tag->name . ' <span>(' . $tag->count . ')</span> </a></li>';
}
?>
</li>
</ul>
This will return the 20 most used tags. Remove , 'number'=>20
to get all tags.
Related Posts:
- display most popular tags in two columns
- Edit tag cloud widget number
- How to automatically apply woocommerce product title to all product images alt tags?
- remove tags from posts in php
- tag search using WP_Query
- show limited tags in an article
- How to add a post or page tag to the list of classes appearing in the body tag’s class attribute?
- dynamic sidebar not showing anything
- Displaying Only Certain Tags in Loop
- query if on page/2/?
- Styling images coming from another blog
- Highlight Current Tag in wp_tag_cloud
- sidebar isn’t showing, what’s wrong w/ this code?
- Add relevant tag to search results
- Must Use Plugin Causing Query Error
- WordPress widget/sidebar dividers?
- Inject PHP code into “sidebar-content” – code before my WooCommerce sidebar widget?
- How to show a dynamic_sidebar if main content content’s height is > a set amount?
- Where do posts get the sidebar from?
- Missing sidebar parameter “fix” – before_content
- Adding country tags automatically
- Way to querry data (tags) from a wordpress database?
- Dynamic Sidebars & Echo
- Child page menu in sidebar
- Theme developement – incative sidebars
- Adding Taxonomy Image to taxonomy loop [closed]
- Generate sidebar depending on height of post
- If tag equals then show else show
- Way to bulk make all my tags lowercase?
- Pull Tags But Not as Links
- Adding Meta Tags to a Post using its Tags, Excerpt and content
- List posts that don’t have a specific tag?
- if statement with is_active_sidebar()
- How to determine if the sidebar is empty? Or not active?
- Edit the_category (); for a hierarchical display
- Need to put a script above tag in header.php – WP 5.7.1
- Sidebar not appearing in footer, but it appears everywhere else!
- Use Tags to initiate Search
- Filtering a function’ output for a new continued function
- Trying to prepend a Hashtag symbol to the_tags links [closed]
- stripping tags from excerpt in WordPress is not working
- Creating a blog on my companies new website using WordPress but I have sidebar issues
- How to remove sidebar primary widget on Mobile on category page [closed]
- Removing sidebar on category pages
- How to tag the main tag? [closed]
- Querying for specific tags
- Limit tags shown in post
- Why the dynamic_sidebar() call is putted into an ul tag?
- Add a select-option to the default widgets
- Display Custom Field in Sidebar if Value is Present
- Commas in Tag Cloud
- Don’t display a sidebar widget when on a specific page
- making my own “related pages” / “pages you might like” section
- Getting a WordPress tag to print inside of a traditional php echo
- remove specificly the last tag in all posts
- How to exclude labels from certain categories in a shortcode?
- Retrieve the whole widget sidebar and pass it inside an html
- Tag title not being returned in page title of tag archives
- Loading Widgets Via Child Theme
- How to add Text before my Custom Term and hide it when empty
- Multiple Tag Filtering
- Force Sidebar on Full Width page
- How to put a before and after with tags in a wordpress entry?
- How do I create a WP endpoint that retrieves all custom post types that have a tag?
- Display child-page links in sidebar on both Parent Pages AND Child Pages
- Blog Image and Title in Right Sidebar
- View tag description on page
- Display tag links on archive page?
- Using Tag Groups: Displaying groups and adjacent tags of current post
- What image is this pulling?
- Show content by using tags
- How to associate dynamic PHP page for chosen WordPress tag?
- Get a list of tags present in a paged front page
- How do you change the tag font size in the repeater-template.php [closed]
- PHP tag in post content makes wordpress go crazy
- How can the searchform.php know if it’s used on a registered sidebar id ‘sidebar-1’ or ‘sidebar-2’?
- Add Alt attribute to image served with php
- Notify admin (by email) if post added with specific tag
- How to list categories by page id in wordpress
- Display product attributes for current product
- How to only fetch certain Tag ID’s
- Adding a sidebar to wp-login.php
- how to run a php code in widget?
- A Space being added to url generated by custom plugin
- if conditional in sidebar plugin Password content shortcode
- Insert wordpress tags below posts via functions.php
- Using tag to output text in Genesis?
- Is there a way to randomize and connect a background and header image?
- WordPress – show all posts + ones with specific tag
- My custom widget won’t stay in the widget area after I refresh the widget page
- how to remove sidebar from particular one page
- Listing current pages subp page in list items in the sidebar
- How to display different widgets on specific pages, hide from other pages
- Sidebar doesnt get updated?
- Php echo into tag
- Change background image based on tags
- Exclude specific product tags from related products in WooCommerce 3+ [closed]
- how to loop through blog posts in php
- The search doesn’t work properly
- Need Help With Making Full-Width Template for Blog Posts (common methods aren’t working)