Skip Navigation

[Resolved] Show and Hide list of posts in a view subject to user selecting Show or Hide

This support ticket is created 4 years, 10 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
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 2 replies, has 2 voices.

Last updated by janeC-2 4 years, 10 months ago.

Assisted by: Nigel.

Author
Posts
#1544085

I want to show a view using Blocks.

I can show the list of posts
I want the user to be able to select Show or Hide radio buttons

The list of posts should only show the ones with Show selected.

I can't work out how to put a view inside a conditional statement in Blocks

#1544325

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Screenshot 2020-03-09 at 11.42.11.png

Unless I've misunderstood what you are trying to do it sounds like you are going about it the wrong way.

You have posts with some custom field that "show" and "hide" options.

You want to use a View to display a list of only those posts that have the "show" value for this custom field.

In which case you need to add a Query Filter to the View.

With the Blocks-UI you need to have selected the View block itself (not one of the inner blocks), the easiest way to do that is using the block navigation shown top-left in the screenshot, where you will then see a Query Filter settings section in the sidebar (bottom right in the screenshot).

Add a filter for your show-hide custom field there.

#1545075

You're amazing Nigel! Thank you so much.
**Resolved**