-
Johnny1885
Hi,
since an update… my Buttons in Editor are different than in webseite.Webseite is korrekt.
In Editor it is always centeredI use this Button-Style in as Day Intenary in Tourpgrograms
Since an update its wrong
-
Alvind
Hi there,
Can you try deactivating all plugins except GP Premium and GenerateBlocks to see if another plugin is causing the issue? Sometimes a plugin can enqueue CSS in the block editor, which may lead to layout inconsistencies.
If the issue persists after deactivating other plugins, feel free to provide a temporary admin login so we can take a closer look.
-
Johnny1885
still same problem
-
Johnny1885
i “guess” this css from gb cause problem:
.gb-button-wrapper>.block-editor-inner-blocks>.block-editor-block-list__layout {
align-items: flex-start;
display: flex;
flex-wrap: wrap;
justify-content: flex-start;
margin-right: 0;
}– display: flex;
Or?
-
Alvind
That seems to be the issue. You can move the button block outside of its container to ensure the layout in the editor matches the frontend output.
I’ve already applied this adjustment to the “Tag 1” button, you can check it now. It should appear in the correct position as displayed on the frontend. Let me know if you’d like me to revert the changes.
-
Johnny1885
Just to clarify – the issue only exists in the editor, not on the actual website. Frontend output is fine.
I’m using this button layout in over 5,000 places as part of day itineraries in tour programs on different sites and hundrets of tour itenaries. Since a recent update, all buttons are now shown centered in the editor, even though they’re left-aligned on the site.
This wasn’t the case before, and now the editor view is really misleading. It’s not practical to go back and manually adjust thousands of buttons just because of how the editor styles changed.
Would it be possible to roll this back or at least offer a way to disable it? Would really appreciate a fix.
-
Try this PHP code:
wp_add_inline_style( 'wp-block-library', '.block-editor span.block-editor-block-list__block.wp-block.gb-button.wp-block-generateblocks-button { margin-left: 0; }' );Adding PHP: https://docs.generatepress.com/article/adding-php/
-
Johnny1885
This helped. Thank you very much Ying!
-
You are welcome 🙂
-
Johnny1885
Dear Ying,
since last udate (yesterday) .. its again!
and
wp_add_inline_style( ‘wp-block-library’,
‘.block-editor span.block-editor-block-list__block.wp-block.gb-button.wp-block-generateblocks-button {
margin-left: 0;
}’
);doesnt help
-
Alvind
Where did you previously add the snippet?
Could you please provide the site again, as it was erased when this topic was marked as resolved?
-
Johnny1885
–>> Where did you previously add the snippet?
sorry.. but how is this questions helpfull?
Yings Solution worked very well until update to Theme Version: 3.6.0 and blocks to 2.1.0
so there are no other changes at all..we use it also on othersites with old version 3.5.1 and 2.0.2 – There is still working
@ying.. could you please help? Thank you -
Can I see the issue on your site?
The snippet is targeting
gb-button, if you change the button to v2, there’s no longer this class to target.Let me know 🙂
-
Johnny1885
please see private information
-
Alvind
Replace the existing code with this one:
wp_add_inline_style( 'wp-block-library', '.block-editor-inner-blocks span.block-editor-block-list__block.wp-block.gb-button.wp-block-generateblocks-button { margin-left: 0; }' ); -
Johnny1885
thank you.
That works.
- You must be logged in to reply to this topic.