• I’d love to be able to make a query header

    ie: IF(has posts) { do something }

    eg. if there are upcoming events, display the heading ‘upcoming events’, if there are not upcoming events don’t display the heading.

    am i missing something? i miss doing this in php!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author ImageRyan Welcher

    (@welcher)

    You should be able to do this using the template in AQL using the the No Results section.

    Thread Starter ImageBack to Front

    (@traverser11)

    Hey thanks for reply,
    Sorry i don’t understand how to use the No Results section for this?
    I want a header above the query, only if the query has posts –
    (eg. Show a heading ‘upcoming events’ but only when there are events coming up)
    So the No Results section only displays if the query returns no posts, right?

    I’ve worked around this with css :empty actually,
    putting the query and a heading inside a group block with the class community-events-content
    But it would be ideal and give more control to do this in the block settings

    .community-events-content:has(~ .wp-block-query:empty) {
    display: none;
    }


    Plugin Author ImageRyan Welcher

    (@welcher)

    Ah! Sorry, I misunderstood what you are trying to do. I have been thinking about this and I think we make this work. Leave it with me!

Viewing 3 replies - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.