Site logo

Archived topic

Query Loop questions

9 replies · Started by Erika on July 18, 2022

Viewing posts 1–10 of 10

Hi there,

some further Query Loop block questions:
1) is it possible to remove the bottom space of the grid (vertical space of the grid is already set to zero)?
2) is it possible to get nine posts randomly? Currently I get the last 9 and can sort by date. How could I get a certain number randomly?
3) how can I post the whole text, not only excerpt with all the paragraphs? Now I have set the excerpt to 200 to display the whole text, but I have no breaks in it.

Thanks,

Erika

Hi there,

1. select the Container block in the Query Loop, and set the Margin Bottom to 0 ( note the field will be empty )

2. Order by: Random is a GB Pro 1.3 option:

https://generateblocks.com/generateblocks-pro-1-3-0/

3. Its not currently a feature, if its something you require i can look to see if can provide some code for that. Let me know.

Hi David,

1) I have the structure: containter > query loop block > grid > post content container
container and post content container margin-bottom are set to 0 already. Some other setting prevents to get margin-bottom:0px;
Can you see which one?

2) I will test it on another site where we have GB Pro. Good to know.

3) Well, on the first post I tried now the method adding the whole post content in html to the post excerpt box and that works. However, that is quite a lot of work to do that everytime for all posts paragraph by paragraph. If you can come up with a code that keeps the formatting of the original post (basically a code that redoes the deleting of the formatting in the WP core :D), I´d appreciate that.

Another way would be to display the whole post content instead of only the post excerpt... whatever is the easier way...

Thank you, Erika

1. hmmm - something else we need to consider.
Try setting Grid Gap to an actual 0 value.

if not:

Try adding this CSS:

.gb-grid-column.post {
    margin-bottom: 0;
}

3. So just to be clear, you would like to simply preserve the HTML in any size of excerpt ?

1. The Grid Gap was already set to 0 :) but the css works now. Actually I thought that the 40px came from the Customizer somewhere, but couldn´t find it and it doesn´t matter now. Solved.

3. Yes, now that the other issue is solved, basically I have only text in these blog post and I´d like that they are displayed exactly like they are in the blog post, with nice html <p> breaks. Just like the first example on the page where I added the html to the excerpt box.

3. Try adding a Post Content block ( its a core block ) instead of the Excerpt.

Hi David,

yes, that would be the solution and that´s what I wanted to do. However, in the dynamic data list there is no Post Content in the Query Loop block. In the WP Loop Query yes, it is there. Not in GB´s list - not even in the Pro Version.

See pictures.

Erika

Hi Erika,

I can see it in your screenshot: Beitragsinhalt.

Can you try adding that?

Example of WP Post Content within the GB Query Loop: https://share.getcloudapp.com/jkuX86vG

Kindly let us know how it goes.

Hi Fernando,

yes, that was it!

Thanks for the patience.

Erika

You’re welcome Erika! Glad that worked!

This archived topic is closed to new replies.