Skip Navigation

[Resolved] How to display the count of child posts as a nested view?

This thread is resolved. Here is a description of the problem and solution.

Problem:
How to display the count of child posts as a nested view?

Solution:
User was using block and with blocks we do not suggest to use nested view. Basically, nested views are not supported in block mode.

You can find the proposed solution in this case with the following reply:
https://toolset.com/forums/topic/how-to-display-the-count-of-child-posts-as-a-nested-view/#post-2259905

Relevant Documentation:

This support ticket is created 3 years, 1 month 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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 4 replies, has 2 voices.

Last updated by sietseR 3 years, 1 month ago.

Assisted by: Minesh.

Author
Posts
#2258539
Schermafbeelding 2022-01-04 194128.png
Schermafbeelding 2022-01-04 194105.png

Tell us what you are trying to do?
I made this homepage (hidden link), where I want to display the amount of Answers (child) to a Question (parent).
This has to be inside the View, which I made with the block editor, but from many support articles I found that I have to make a legacy View to display this count through [wpv-found-count] or [wpv-items-count], but it doesn't display anything.

I attached two screenshots with my current settings. What am I doing wrong?

Thanks in advance.

#2259089

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Can you please share admin access details and let me check whats going wrong with your setup. Also please share screenshot how exactly and where you want to display child post count.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#2259237

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Unfortunately - the admin access details you shared is not working at this end. Can you please share working admin access details.

I have set the next reply to private which means only you and I have access to it.

#2259905

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

I checked and I found that you are adding the view created using block as nested view. Basically, nested views are not supported in block mode.

So, what you should do is as you just want to display the the child post count, rather adding the child view in block mode, you should add a "Fields and Text" block and then try to add your view:

[wpv-view name="your-view-slug"]

I see your site is too slow at this end and having many issue and I do not able to remove the view that you added inside the view so you should try to generate another view that display questions and then to display child post count of answer you should add the "fields and text" block as suggested above.

#2260023

I found the answer on my own, because of this post: https://toolset.com/forums/topic/show-count-of-child-posts/

What I had to do was this:
1. Make a new Content Template
2. Add a new View Block to this content template, selecting the Child post as Content Selection, adding a filter "Select posts in Any relationship that are a related to the current post in the loop."
3. Add the Shortcode [wpv-found-count] ABOVE the View Output
4. Add the Content Template Block to the page where it has to be shown.

That's it. It's a pity these things are not documented very well, because I think these are basic things for any website with CPT's. I think you should add this to the documentation.