Skip Navigation

[Resolved] Show Taxonomy count belongs to child post only

This support ticket is created 7 years, 12 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 1 reply, has 2 voices.

Last updated by Beda 7 years, 11 months ago.

Assisted by: Beda.

Author
Posts
#398545

Dear Sir/Madam,

I want to make a Taxonomy list with count in widget, I created the custom Taxonomy with Types but the Taxonomy is shared for both parent and child post, how can I only count the number of posts from the child post only?

For example, there are 3 parent posts assigned to Taxonomy "Culture Program" and 15 child posts assigned to this Taxonomy also, I only need to list the Taxonomy count 15 but not 18.

Best regards,

Kelvin.

#398645

1. Create a Post View and query your Child Posts

2. Set a query Filter to return only posts of the Taxonomy set by the Parent taxonomy View

3. Include the [wpv-found-count] ShortCode in your Post View (outside the Loop HTML tags but inside the [wpv-items-found] ShortCode)
https://toolset.com/documentation/views-shortcodes/#wpv-found-count

4. Include this View in the Parent Taxonomy View Loop and display this Taxonomy View in your Widgets.

This should solve the issue.

You will need of course to determine what Taxonomy Should be queried by the Parent Taxonomy View.

DOC:
https://toolset.com/documentation/user-guides/views/
https://toolset.com/documentation/user-guides/using-a-child-view-in-a-taxonomy-view-layout/
https://toolset.com/documentation/user-guides/filtering-views-by-taxonomy/

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.