Are you a GenerateCustomer?

Do you have an active GP Premium or GenerateBlocks Pro license key?

Create a GenerateSupport account for GeneratePress and GenerateBlocks support in one dedicated place.

Create an account
Already have a GenerateSupport account? Login

Just browsing?

Feel free to browse the forums. Support for our free versions is provided on (GeneratePress, GenerateBlocks).

Want to become a premium user? Learn more below.

Conditional within query loop?

  • We are using LearnDash LMS on our site, and we are wanting to display some custom fields CONDITIONALLY (if the value is blank, we hide the block). We are doing this successfully using Toolset Conditional block on the single course page: But we are using a query block on the course listing, and the Toolset Conditional block doesn’t seem to play nice inside the query loop: (it only lists “credits,” which is the first of 3 conditional blocks within the query loop). Do you have a suggestion to replace the Toolset Conditional block or create the conditional in some other way? Or perhaps you know of how to make these two play nice together?

    Screenshot of query loop:

  • I’m not familiar with the toolset, so I can not help with that unfortunately.

    A workaround within GP is to use the GB container condition, but it’s only available in GP’s element.

    You might want to copy the page content and paste it into a GP block element – content template, and set the location to be page > courses.

    Here’s an example of how to use the remove container condition, as you can see the headline is pulling post meta > reviewer, then I set the parent container of the headline to be removed if there is no reviewer post meta for the post:

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.