Hello. Thank you for contacting the Toolset support.
Can you please clarify what conditions you want to apply and what content you want to display conditionally as well as share problem URL and tell me on what section you want to apply condition.
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.
I have set the next reply to private which means only you and I have access to it.
I see on this page there is 3 items available with the conditional:
- hidden link
What exactly you want to display or what is your requirement I still do not get it. What condition you want to add or what exactly you want to display conditionally?
Sorry I thought I had explained better. I know you don't have if than else conditional. I stated that earlier. I said I am trying to mimic one in order to display ,on online ad instead of an empty page. This could just be a heading or anything conditionally. I tried checking for nothing being displayed by view and as you see that value is three like the loop count. I thought it would be empty or zero since nothing is displayed by the view. I then looked for a way to check the output from previous conditional an can't find anything in the list for short codes to check.
I hope this explanation is enough to get a resolution.
As I understand - you have a section with heading and within the heading you are displaying the related content using the view.
What you want is if there is no item available to display with view, you also want to hide the heading as well. If this is correct then:
What you should do is, try to add a conditional block and configure it to check with view's shotcodes and further select "number of items found in view" and compare it as shown with the following image:
=> hidden link
Then move the conditional block between view's output and view's loop section as shown with the following image:
=> hidden link
And add whatever heading you want to display using heading block within the conditional block. The condition will check if there is any items to display then it will display the heading otherwise not.
If you can't understand what I've sent you, please pass this on to someone else.
This is not that difficult so if you have a language barrier or just can't see the obvious with all that I've sent you you need to pass this to someone else.
Reviewing through the existing messages and the current setup on your website, here are my recommendations:
The view 'Current Subscription' is set to show 'All Products' and then limit the results through a conditional block within the loop. As a result, the actual number of results that view brings in at the query level, differs from the number of items, shown on the front end.
To make use of the option 'Number of items found in Views' in the conditional block on the 'Subscriptions' page, our objective should be to limit/filter this view's results, at the query level and not through a conditional block within.
To achieve this you can add a new select type custom field with the 'Products' post type, named 'Allowed Roles', with options: 'Premium', 'Basic', and 'Subscriber'. Please make sure that the user role slugs and the option values of this field matches.
Through this custom field, you'll be able to filter/limit the results in the view 'Current Subscription', based on the current user role and this custom field value, using a custom function attached to the hook 'wpv_filter_query': https://toolset.com/documentation/programmer-reference/views-filters/#wpv_filter_query
(without having a conditional block to match the product titles inside the loop)
I hope this helps and please let me know if you need further assistance with this.