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.

Default Featured Image in Query Loop

  • In Generateblocks v1, it was possible to set a background container and a dynamic image based on the featured image.
    How do I set this up in GB v2?

    https://prnt.sc/PV_9KH6P1IxP

  • Hi there,

    In V2, you can use the Featured Image dynamic tag and set it in the Inline Background Image field:

  • Hi Alvin,
    I don’t have this option there because the container is not a div, but an a tag.
    https://prnt.sc/UHSeKMsyes4n
    The image is set via Styles – Background.
    https://prnt.sc/inbOlv2Dwz1x

  • Okay, I looked back at your structure, and you don’t need to add that extra container for the background image. You can use the Loop Item block itself to set the background image—if the block is set to a tag, the Inline Background Image option is still available.

    The image set under Styles – Background is fine—no changes needed. The var(--inline-background-image) will pull the dynamic image set in the Settings panel.

  • When I move the background to item-loop, scale won’t work on hover—it will enlarge outside the container.

    I don’t quite understand whether to leave the container with the background. Or set the fixed default image as the background on item-loop?

  • I don’t quite understand whether to leave the container with the background. Or set the fixed default image as the background on item-loop?

    I don’t quite understand what you mean, can you explain some more?

  • Hi Ying, I responded to Alvind because I didn’t understand.
    I asked how to set the default featured image in the existing structure when it is not filled in for the post. In GenerateBlocks v1, it was very easy. I cannot move the dynamic background image to the loop item because then the hover scale will not work—it will overflow the loop item container.

    https://prnt.sc/up2rXxAw_H9h

  • I see, it’s simply in v2 as well.

    You can add another background image in the backgrounds panel, under the dynamic background image, and choose a static image, it will show when there’s no featured image.
    https://app.screencast.com/mPN9czeRb6SWT

  • I’ve already tried that, but the fallback image doesn’t show up. Posts that don’t have a featured image set will appear white, and the link doesn’t work either.

    https://prnt.sc/Wzhl7mGzj0Vj

  • Can you check the dynamic image setting? Did you check the Required to render option?

    If so, uncheck it, let me know if this helps!
    https://app.screencast.com/FxWehzqyEqFkW

  • In Style, I only see var(–inline-bg-image) for the background. There is no checkbox here.

    I had to switch the label name from a to div and reinsert the featured image. I unchecked the Required to render option checkbox. I switched the label name to a.

    https://prnt.sc/AS2UpaFsg7n_

    I see a white background in the editor, but it’s OK in the frontend. Is it ok?

    But yes, it helped. 🙂

  • Yes, the editor is trying to load the featured image in the editor, but on the front end, it should be ok 🙂

    Glad you’ve got it working!

  • Thank you very much for your help. You´re best. 🙂

  • You are welcome   🙂

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