[Resolved] Using total count of unfiltered posts as conditional: if [wpv-found-count] < ALL
This support ticket is created 5 years, 7 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.
No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.
I have a CPT ('Businesses') with an associated taxonomy ('Business Category'). There are 152 Businesses listed in total.
I have created a view that lists Businesses using a parametric search filter that filters by the associated Business Category.
When the page is first loaded, the default_label for the wpv-control-post-taxonomy is 'Select a Category', which lists all 152 businesses.
I would like to hide the list of businesses until a Business Category is selected from the dropdown list.
I would therefore like to be able to create a conditional that uses the total number of Businesses (unfiltered) and only displays the results if the number is less than 'ALL' or if the the default_label is selected. Is this possible?
I have managed to do this by hard-coding the number (152) but obviously this is going to be a dynamic number:
Thank you Minesh. However, this doesn't seem to help.
I think that all I need is to be able to create a custom shortcode that returns the total number businesses that I can then use in the conditional statement - for example: