Skip Navigation

[Resolved] Show the total (number) of different countries and provinces

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/Karachi (GMT+05:00)

This topic contains 1 reply, has 2 voices.

Last updated by Waqar 10 months, 2 weeks ago.

Assisted by: Waqar.

Author
Posts
#2671163
Noord-Holland.JPG
Nederland.JPG

Hi there,

On my homepage I want to show the count of different countries and provinces.
So for example on hidden link the country 'Nederland' 2556 and the provinces 'Noord-Holland' 113.

So that the correct number is always shown on the homepage.

Is this possible?

#2671585

Hi,

Thank you for contacting us and I'd be happy to assist.

The count that currently shows on the top of the view results, is the count of results that the view's current search/query produces.

I understand that the countries and the provinces are linked to the searched post type through the post-relationships.

There is no straightforward method to show the count of results found through the combination of all countries and provinces. And even if some custom code or views are used to show these numbers on the top, it will have a performance impact.
( because a lot of complex database queries will be involved )

One possible workaround could be to store the count of related results/listings with each country and province post, as a custom field value. The custom code that will be required to automatically update this custom field value each time a listing, country, or province post is updated, is too complex to be provided over the support forum. But, for more personalized assistance around custom code, you can consider hiring a professional from our list of recommended contractors:
https://toolset.com/contractors/

regards,
Waqar

#2671899

Okay thanks. I will do.

michelL confirmed that the issue was resolved on 2023-12-08 10:00:46.
This ticket is now closed. If you're a Toolset client and need related help, please open a new support ticket.