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?
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