Skip Navigation

[Resolved] show count of child posts

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

Problem:

Display child post's count in a nested views.

Solution:

You can add a new view block:

- Query child posts

- Filter by:

Select posts in Any relationship that are a related to the current post in the loop.

- Outside view's loop, display the post found count shortcode, like this:

[wpv-found-count]

Relevant Documentation:

https://toolset.com/course-lesson/displaying-related-posts/#displaying-many-related-items

This support ticket is created 3 years, 10 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
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9: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/Hong_Kong (GMT+08:00)

This topic contains 16 replies, has 2 voices.

Last updated by antonK-2 3 years, 10 months ago.

Assisted by: Luo Yang.

Author
Posts
#1898039
nested.png
Снимок экрана 2021-01-08 в 0.51.28.png

Tell us what you are trying to do?
I'm putting Views of child post into parent section and get error: Nested views creation is not supported at the moment.

Is there any documentation that you are following?

Is there a similar example that we can see?

What is the link to your site?

#1898225

Yes, you are right, the nested views are not available within Blocks editor, as a workaround, you can try these:
1) Create a content template, display the child post view
2) In the loop of parent view, display above content template

#1898313
Снимок экрана 2021-01-08 в 12.12.33.png
Снимок экрана 2021-01-08 в 11.59.02.png

Thank you! It solved this issue, but there are new one. Result - "No items found" while parent post has child posts.

#1900689

It might be a cache problem, please try these:
Edit the content template, find and select the child view block, disable the view's cache and test again.

#1900955
Снимок экрана 2021-01-11 в 12.00.29.png
Снимок экрана 2021-01-11 в 12.00.20.png
Снимок экрана 2021-01-11 в 11.58.19.png

still result "not found"

#1900981

The problem you mentioned above is abnormal, please try these:

1) Make sure you are using the latest version of Toolset plugins, you can download them here:
https://toolset.com/account/downloads/

2) In case it is a compatibility problem, please deactivate all other plugins, and switch to wordpress default theme 2021, deactivate all custom PHP/JS code snippets, and test again

3) Also check if there is any PHP/JS error in your website:
https://toolset.com/documentation/programmer-reference/debugging-sites-built-with-toolset/

4) If the problem still persists, please provide database dump file(ZIP file) of your website, you can put the package files in your own google drive disk, share the link only, also point out the problem page URL and view URL, I need to test and debug it in my localhost, thanks
https://toolset.com/faq/provide-supporters-copy-site/

#1901891

I have requested the access to the link you provided above, please grant it and update this thread, thanks

#1902103

I provided details in previous private replay

#1902163
google-access.JPG

I have tried again the google drive disk link, but get below message:

You need access
Ask for access, or switch to an account with access.

See my screenshot google-access.JPG

And I have requested the access again, please grant it, then update here.

#1902231

sorry, I thought you need access to my site.

Please check link, I opened google access.

#1903369

Thanks for the details, I am downloading the files, will update here if find anything

#1903487

I can install the duplicator package in my localhost.
In the parent view "Khr_ryad", you are using below fitler:
Select posts with the author the same as the current logged in user.
So in order to see the same problem as your screenshot, it seems to need a specific logged-in user
Please provide detail steps to reproduce the same problem:
Which user can I login and see the same problem

Thanks

#1903703

pls enter as admin (not helper)

#1904629
vol.JPG

Thanks for the details, I suggest you try these:
1) Edit the content template "parent_hr_shs":
hidden link
replace the view block with a new view block:
- Query Volshebnye_volny posts
- Filter by:
Select posts in Any relationship that are a related to the current post in the loop.
- Outside view's loop, display the post found count shortcode, like this:
[wpv-found-count]

See my screenshot vol.JPG

#1905787

thank you!! it work. Could you please explain me a logic?

Thank you in advance!