I am trying to display a custom taxonomy count for ONLY the child posts. This is what I have
Parent Posts
Each parent post has its own child posts.
Each child post has 3 taxonomies
I want the parent post to display a count of taxonomies in its children only.
Currently I am getting a full count of all the taxonomies of all the child posts.
Setup:
1 Content Template which displays the Parent Post.
Within it I have a VIEW as follows:
Content Selection - Payment Reports (the child posts)
Query Filter: Select posts that are children of the Post where this View is shown.
Limit and Offset: 1
Loop output editor:
[wpv-layout-start]
[wpv-items-found]
<!-- wpv-loop-start -->
<wpv-loop>
[wpv-view name="payment-status-taxonomy"]
</wpv-loop>
<!-- wpv-loop-end -->
[/wpv-items-found]
[wpv-no-items-found]
<strong>[wpml-string context="wpv-views"]No items found[/wpml-string]</strong>
[/wpv-no-items-found]
[wpv-layout-end]
The above has this view in it:
Name: Post Status Taxonomy.
Content Selection: Taxonomy > Payment Statuses
Query Options: Include terms that have non-empty descendants, Include children in the post count
Limit: None
Query filters: None
Loop Output Editor
[wpv-layout-start]
[wpv-items-found]
<!-- wpv-loop-start -->
<wpv-loop>
[wpv-post-body view_template="Loop item in Payment Status"]
</wpv-loop>
<!-- wpv-loop-end -->
[/wpv-items-found]
[wpv-no-items-found]
<strong>[wpml-string context="wpv-views"]No items found[/wpml-string]</strong>
[/wpv-no-items-found]
[wpv-layout-end]
Templates for this View
<span class="badge [wpv-taxonomy-slug]">[wpv-taxonomy-post-count] </span>
As you can see from the screenshot attached, I get an output of 2 Green, 1 Red, 2 Orange but this is wrong. It is picking up the count of taxonomy from another post. It should display: 2 Green, 1 Red, 1 Orange.
Any help would be greatly appreciated.