Conditionally display section only if posts of custom type exist

I have created a custom post type for news updates, and am displaying them in a page section using a looper provider/consumer setup. This is working fine.

This is probably simple, but I seem to be missing something here … what I would like to do is set the display condition of the whole section so that it only displays if there exists at least one post of this custom post type.

How do I do that?

Hello SteveE,

Thanks for writing in! To get your issue resolved, your Section element should be a Looper Provider and then add a condition to it.

And your condition will be “Looper Provider Output is not Empty”:

Having the Section in this way, the Section element will only display if there are at least one post item that is returned by the Looper.

Kindly let us know how it goes.

Thank you!!! Worked great.

Hello SteveE,

Glad that we were able to help you, please feel free to open a new thread if you have any more concerns.

Thanks

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.