Skip Navigation

[Resolved] How to show amount of related items in relationship

This support ticket is created 2 years, 8 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 1 reply, has 2 voices.

Last updated by Luo Yang 2 years, 8 months ago.

Assisted by: Luo Yang.

Author
Posts
#2322107

I have a relationship City (1) to University (N). I want to show amount of universities in City. How to do it?

#2322535

Hello,

In the single "City" post, you can create a post view:
- Query "University" posts
- Filter by the relationship between City and University
- Outside View's loop, display the post found count shortcode [wpv-found-count]:
https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-found-count

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