I think you can try the following options.
wp_list_categories
with the 'show_count'
parameter
http://codex.wordpress.org/Template_Tags/wp_list_categories
get category
and use $count = $category->category_count;
http://codex.wordpress.org/Function_Reference/get_category
You can traverse up the functions to get_term
if those don’t work and see what is in there, even though you probably can use get the terms
you will have to parse the array for output as can be seen in your example, so the above 2 methods would most likely be better.
Related Posts:
- have_posts() return false but count says “3”
- Get posts that matches specific terms of multiple custom taxonomies
- Using get_term() in functions.php results in Invalid taxonomy error
- Trying to get property of non-object in shortocde
- Query posts only with actual text content (not including shortcode or images)
- Avoid WP_Query’s duplicate posts with taxonomies
- Get a Post Loop based on Logged in User information into a Shortcode
- How to add pagination in Terms
- Split Content and Gallery
- How to return loop contents
- Is `query_posts` really slower than secondary query?
- Are there any scenarios where the query_posts may be used?
- How do I get the attributes of a short code from a post?
- Why is it necessary to call rewind_posts() when using the loop more than once? [duplicate]
- WordPress category & taxonomy loop with pagination
- Return vs Echo Shortcode
- Multiple posts with one loop iteration
- Looping Through Custom Tax Terms and Displaying All Posts For Each
- as a shortcode within the loop?
- Post Loop not Returning Permalink
- Filtering posts by multiple taxonomies
- How to Loop within a Loop (Display Children and then Grandchildren)
- Exclude first 2 posts with meta_key from loop
- Adding active/current class to get_terms list
- Adding shortcode closing tag after a loop
- What are the disadvantages of using global variable?
- Better way to display posts from specific categories, in a grid layout
- How can I modify the loop from a plugin without wiping out other filters?
- Change or update WordPress loop based on dropdown selection
- Avoid duplicate post from same Taxonomy
- popular post weekly and monthly
- 3 Posts in Loop, Show Stickies First
- How to return only one instance of each, from the entire loop
- Query last updated posts (posts updated in the last 24 hours)
- Set multiple Post Terms in same Taxonomy
- I write simple wordpress loop for taxonomy.php file but don’t show result
- Missing image in gallery shortcode in custom feed
- Shortcode with a foreach and arguments
- Duplicated posts on category page
- Make blog page show 10 on first page, 9 on every other page
- Output loop leveraged shortcode twice on one page
- How to display posts by vote count and if no value continue with latest posts with no votes?
- Custom Loop Using Shortcode in Custom Page Template
- Shortcode in posts called by ajax is not working
- query_posts() vs get_posts() multiple loops [duplicate]
- Listing all term items alphabetically / sorting loop
- Exclude first post (sticky or not) from the loop using query_posts()
- How to order by multiple fields using standard query_posts?
- Pagination not working in category listing [duplicate]
- How can I improve the performance of this query_posts loop?
- List taxonomy term slugs within shortcode (do_shortcode)
- Distribute Gallery Images Every nth in Loop
- Loop parent terms {display posts} AND loop child terms {display posts}
- Adding div after every two post on main loop! Why will first post not get counted?
- How can I access specific posts brought back by query_posts?
- For each loop on every word in post
- Display name of taxonomy once
- one post per term taxonomy
- Separate First Post Loop
- WordPress shortcode in content, output in sidebar?
- Loop through custom taxanomy in post and display custom fields from posts
- Get most recent post for every term in a given taxonomy type
- query_posts clarification needed
- How to put a block of code between [shortcode][/shortcode] in do_shortcode()?
- Show terms in archive page
- How to break up php code to avoid echo
- How to use this $tax_selection variable in this custom loop?
- Exclude current post ID from loop in sidepbar.php
- How to get the term description in a taxonomy term archive query?
- Related terms – Terms that feature in post of current term
- Why does my WP_Query pagination on a custom page.php only loads the homepage?
- How can I pass additional params to a shortcode while in a loop?
- How to add a shortcode function that returns the taxonomy slug of the actual post within the loop
- Use ACF Category Image for all Taxonomy Archive Views
- how to add 4 post in one carousel slide
- Exclude posts from loop by term
- pages shortcode filtering by category
- dispaly all hierarchical post types from a taxonomy
- Split Content and Gallery
- Shortcode for pulling specific Post Title outside loop when ID is passed in
- Loop shows post 5 times in a query
- Attachment Metadata inside of Loop
- Creating a archive for taxonomy terms, not the term results
- Have multiple loops on a page appear after/between page content
- Query counting excluded category on paged loop
- Using shortcode within shortcode with dynamic variable
- get_posts and wp_autop (remove filter)
- query_posts ignores the argument
- The Loop isn’t working
- Twitter bootstrap carousel multiple items in carousel
- show posts from one category with comments only
- Least Number of Loops to Create Custom Homepage?
- Modify my code – which takes the first sentence of the post and use it as a h2 tag – to work outside the loop
- How wp maps urls into files
- How to do query_posts on tags pages
- Limitless amount of posts in custom archive page
- Get ID of a page containing secondary loop in content
- Checking if a Page has an Associated Term?
- Breaking the loop?
- This webpage has a redirect loop issue with SSL page