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.

Global Styles for images not working as expected

  • Hello!

    I recently created new image Global Styles to set things like alignment and margins on images and have this reflected in the editor.

    I then went through my site and updated my images to use these new styles. Most of them I had to convert from WP image blocks to GenerateBlocks. I ensured that local styles were cleared.

    After that, I went into the Customizer and removed the CSS I was using to control the attributes previously.

    However, when I published the changes and cleared the caches, it seems that:

    – Image padding/margins are not inheriting from the Global Styles, so I had to add this back in using the Customizer for now
    – Caption (headline) padding and margins ARE inheriting from the Global Styles as intended, which is great
    – Image alignment is NOT being inherited from the Global Styles
    – Both padding/margins and alignment look correct while in the editor but NOT on the published pages

    Actually, when I inspect the page, I can see that the Global Styles are being applied to the “img” but not the “figure” class above it, and only when I test the Global Style as a figure attribute does it look correct.

    I’m a bit out of my depth. 😅 Is there a way to resolve this neatly, either with CSS or php?

  • Hi there,

    This is a known bug for GB image block, we’re re-building the image block currently, but it takes more time than we expected. Sorry for the inconvenience.

    For now, we can help with CSS solutions, can you provide an admin login so that I can see the global style settings?

  • Oof, so not an issue that just affects me. That’s good to know! 😅 Dropped some login details into the private info section.

  • Try this CSS, the gb-image-84343f3c is the global style class.

    .gb-block-image:has(.gb-image-84343f3c) {
        text-align: center;
    }
  • Makes sense and seems to resolve the issue for now. Thank you!

  • You are welcome! Sorry for your inconvenience regarding the bug.

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