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

  • 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 🙂

  • 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.

  • Can you please tell me the three different parameters to use. As I mentioned, I cant work them out

    thank you

  • Query loop one:
    Post per page: 1
    Parameter: Sticky posts > Only

    Query loop two:
    Post per page: Depends on how many posts you want to display
    Parameter: Order by > Date

    Query 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

  • 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

  • ..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.

  • 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

  • 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

  • I have pro, does that make a difference?

  • 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 to Cover
    4.2 Aspect Ratio 1/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 🙂

  • 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

  • Yeah for now you can use the free method with the CSS

    Glad to be of help

  • 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

  • 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.

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