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 WordPress.org (GeneratePress, GenerateBlocks).

Want to become a premium user? Learn more below.

Query Loop empty space

  • I have created a query loop with grids. 5 customer cases per grid. The second grid has no image for the moment. But it creates a space. How to remove it when it is empty

  • Hi there,

    Have you resolved the issue?

    Just checked the linked page and don’t see any odd space.

    Let me know 🙂

  • Check HTML after : “Cabinet d’expertise comptable et conseil pour les entreprises” please

    “gb-grid-wrapper gb-grid-wrapper-ed3511d3 grid-portfolio”

  • Hi Alexis,

    Are you referring to having the same height for Grid columns? If so, you can check this Article out: https://docs.generateblocks.com/article/equal-height-grid-containers/

  • No, in fact below the 5 client cases, there is an empty space because I recreated a grid with query loops. But for the moment there is nothing. But it creates a gap. Look above the section “Trust us with your digital strategy!”

  • To assure we’re seeing the same thing, can you share a screenshot of the issue from your end?

    Uploading Screenshots: https://docs.generatepress.com/article/using-the-premium-support-forum/#uploading-screenshots

  • View post on imgur.com

    I have another need also related to the query loop. Can we display a custom message when it is empty

  • The space is coming from the padding set. Try moving the padding to the Post Template Block of the Query Loop instead.

    Can you open a new topic regarding the other inquiry?

  • So there is no solution for this div not to appear as long as there is nothing in the query loop

  • Try adding the padding to the Post Template Block and add this CSS:

    .gb-grid-wrapper.grid-portfolio .gb-query-loop-wrapper:empty{
        display:none;
    }
  • I still have the spacing

  • Hi there,

    the spacing is coming from the grid item containers that each of your empty query loop items are inside of.
    and theres no simple way to tell a container block to do something if the query item inside of it is empty.

    Question – why use a Grid Block with so many individual Query Loop blocks ?

  • Ok, The images are never the same size. Out of the 5 cases.

  • Can you use a single query Loop block to show ALL the posts, and then we can look at how to change the sizes.

  • To do in css ? I’ll tell you that I spent a lot more time on this project and I’m not finished yet. But for the next times I will do like this if it is recommended

  • If you wanted to show a layout like this for example:

    Post 1 | Post 2
    
    --- Post 3 ---
    
    Post 4 | Post 5
    
    --- Post 6 --- 
    
    Post 7 | Post 8

    Then you can make a Query Loop, and set the Post Template -> Sizing -> Width to 50%

    We can then use a couple of lines of CSS to make Post 3 and Post 6 100% Wide.

    Is that what you need ?

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