Skip Navigation

[Resolved] How to use View iteration count inside Conditional to control display of Header

This support ticket is created 3 years, 6 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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

This topic contains 3 replies, has 2 voices.

Last updated by Anthony 3 years, 6 months ago.

Assisted by: Minesh.

Author
Posts
#2075685

I followed the directions at https://toolset.com/documentation/programmer-reference/adding-custom-code/count-the-number-of-views-loop-iterations/ to implement a View loop iteration counter and use it in a Conditional to control the display of a Heading so that the Heading that includes dynamic content does not display if the View is empty. As implemented the Header does not display at all 🙁 - what did I do wrong?

A page that should display the Heading but doesn't is hidden link - the Heading should appear before the display of albums.

#2075695

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Can you tell me at what loop iteration count you want to display the heading?

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) 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.

#2075733

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

I just change the condition for your conditional block as you can see with the following screenshot and I can see its working as expected:
=> hidden link

Can you please confirm it works at your end as well.

#2075735

My issue is resolved now. Thank you!