I want to display counts of posts and some other taxonomies, i am using Short Code from Admin bar and Toolset - Fields and Views-> under taxonomy i have selected "Cities" and Display option -> Term post count and generated short code [wpv-post-taxonomy type="city" format="count"] but when i place this on any page, elementor or classic editor, no data is showing, tried creating shortcode with different parameters also, please help.
Thank you for contacting us and I'd be happy to assist.
The shortcode "wpv-post-taxonomy" should work when used inside any single post/page's content or loop of the view, where this "city" taxonomy is attached.
If including the "item" attribute also doesn't work, you're welcome to share temporary admin login details, along with the example page where this shortcode is not working.
Note: Your next reply will be private and making a complete backup copy is recommended before sharing the access details.
As you haven't shared any exact place where the shortcode wasn't working, I tested it inside the template for the single property posts ( "Content template for Property 2" ).
At the bottom, you'll see the shortcode added in a "Fields and Text" block.
( screenshot: hidden link )
And, you'll see that it is showing the count of the posts attached to the current post's "city" term correctly.
Screenshot from the property post "Bhakti Kutir Hotel, Karwar": hidden link
This property post is attached to the "Karwar" city taxonomy term and if you'll search it in the list of city taxonomy terms in the admin area, you'll see that the count of posts attached to it, matches the one showing on the front-end.
( screenshot: hidden link )
This suggests that the "wpv-post-taxonomy" shortcode is working as expected. If you tried to use it at some other place and it didn't work there, please share the exact steps, and I'll check it out as well.
1. To show the count of the posts attached to each taxonomy term, you can create a taxonomy view using the classic/legacy editor.
For example, for cities, you'll create a taxonomy view that will cycle through all the taxonomy terms from the "Cities" taxonomy. In the loop of this view, you'll show the term name, and the same "wpv-post-taxonomy" shortcode to show the count of its posts. This way your list of all city names with their post count will be ready and you can place that view's shortcode in the Elementor builder too.
Similarly, you can create more taxonomy views for the other custom taxonomies too.
I've created an example view named "View to show count of Beaches posts":
{yourwebsite.com}/wp-admin/admin.php?page=views-editor&view_id=3513
Please note how I've selected the "Beaches" post type in the content selection settings.
( screenshot: hidden link )
In the view's "Loop Editor" section, I've only included the line "Total Beaches:[wpv-found-count]" and the view's actual loop is empty, as we don't need to show anything from each result/post.
( screenshot: hidden link )
Similarly, you can create more views for the other post types, and you'll only need to change the target post type, in the view's "Content Selection" section.