-
nfedesign
Is it possible to style a page with 3 sections of query loop.
One is to show sticky post only (or simply one selected post)
Two is to show most recent post
Three is to show all other posts (excluding the sticky/ selected post and the most recent post)I am just a bit confused about some of the options and can’t find all of the above
thank you 🙂
-
Alvind
Hi there,
Yes, it’s possible. You just need to use three Query Loop blocks, each configured with the parameters to achieve your intended output.
-
nfedesign
Can you please tell me the three different parameters to use. As I mentioned, I cant work them out
thank you
-
Alvind
Query loop one:
Post per page: 1
Parameter: Sticky posts > OnlyQuery loop two:
Post per page: Depends on how many posts you want to display
Parameter: Order by > DateQuery Loop three:
Post per page: Depends on how many posts you want to display
Parameter 1 : Offset > Enter the matching number of post per page on Query Loop two.
Parameter 2: Sticky posts > Exclude -
nfedesign
Perfect.
To follow on – is there a way to force the featured image to show at a certain ration in the query loop?
Is there a way to say if you want it to be masonry view?
thank you
-
Alvind
..is there a way to force the featured image to show at a certain ration in the query loop?
Could you clarify what you mean by this? You can construct the image layout size as usual in the block editor.
Currently, the Query Loop block does not support a masonry layout by default.
-
nfedesign
Sorry about the typo.
I meant to say ratio. So, to force the feature image to crop square in the query loop, regardless of what size it is on the actual page / post.Bummer about no masonry option
thanks
-
David
Hi there,
to force the image aspect ratio in the free version of GenerateBlocks requires some CSS.
1. add this CSS to your site:
.force-aspect-1 { aspect-ratio: 1/1; object-fit: cover; }
2. select the Image Block inside the Query Loop Post Template, and in Advanced > Additional CSS classes add:
force-aspect-1
-
nfedesign
I have pro, does that make a difference?
-
David
In Pro you can create a Global Style to do this:
1. select the Image Block
2. in the block settings sidebar create a new global style with a name eg.aspect-1
3. start with a blank style
4. in the global style setting Media panel set the:
4.1 Object Fit toCover
4.2 Aspect Ratio1/1
5. exist the global style and update the page to save the style.Regarding the Pro license.
At the top of the sidebar of this forum theres an option to link your GenerateBlocks Pro license key.
This will allow us to see you have GB Pro on your user profile 🙂 -
nfedesign
Perfect will look to update the pro. It’s because I still had a few months left of the GP pro and then I brought the full package so I have two different serial numbers. Will try work it out.
Thanks for the tips on the global style
-
David
Yeah for now you can use the free method with the CSS
Glad to be of help
-
nfedesign
thanks David,
I have done the global style, this is all sorted now.I have the pro licence but I am not sure how to add that to my support profile so I might send an email about that
thanks
-
David
I see the email regarding the license. I’ll reply there or ask one of the accounts team to reply. But theres no problem it not being attached , it just means we may have to ask you if you’re using GB Pro too.
Glad to be of help.
- You must be logged in to reply to this topic.