- This topic has 7 replies, 5 voices, and was last updated 3 years, 1 month ago by
Tom.
-
AuthorPosts
-
March 4, 2023 at 6:29 am #2555237
webintas
Hi there,
I am building a new site with GP Premium and just Gutenberg. I have been used to start WordPress sites by installing Classic Editor and Elementor but now i wanted to give Gutenberg a shot to make the site as clean and WP’ish as possible.
However, sometimes I really need to add some margin or padding to an element. Do you know if there are some kind of setting that can activate that? I have been looking this document: https://developer.wordpress.org/block-editor/how-to-guides/themes/theme-json/ but to be honest I do not understand that much of it. I think margin and padding should be a default option in Gutenberg. Do you know if it’s possible to add – I prefer non-plugin solutions?
March 4, 2023 at 6:54 am #2555270David
StaffCustomer SupportHi there,
for core blocks you can add this PHP Snippet:
add_theme_support( 'custom-spacing' );Adding PHP: https://docs.generatepress.com/article/adding-php/
If you want a more advanced editor then use the GenerateBlocks plugin
March 4, 2023 at 7:12 am #2555293webintas
Hi David,
Thanks for your reply!
I have tried the custom-spacing-thing but that only gives me padding. Do you experience the same?Best Regards,
PeterMarch 4, 2023 at 11:59 am #2555671Leo
StaffCustomer SupportI have tried the custom-spacing-thing but that only gives me padding.
That is correct behaviour as suggested here: https://developer.wordpress.org/block-editor/how-to-guides/themes/theme-json/#backward-compatibility-with-add_theme_support
From that table, I don’t see a command for adding margins though.
If you are after complete control over the blocks, then I would highly recommend using GenerateBlocks as David mentioned. The Spacing options should provide exactly what you are looking for:
https://docs.generateblocks.com/article/spacing-options-overview/I can almost promise that your Gutenberg experience will be a lot better if you use GenerateBlocks 🙂
March 6, 2023 at 12:07 am #2557005webintas
Hi Leo,
Thanks for your reply and clarification! I am considering GenerateBlocks. However, it will not add margin options for standard blocks as image, right?
Also, from my client’s perspective it is confusing that there is no Danish translation and also it makes “duplicate” blocks, where there are two options for e.g. Headline – the default and the GenerateBlocks-one – that’s confusing for everyday WordPress editors I guess.
Best Regards,
PeterMarch 6, 2023 at 12:44 am #2557021Fernando Customer Support
Hi Webintas,
Yes, that’s correct. It won’t add those options for WordPress Blocks. The options would just exist for GenerateBlocks blocks.
What exactly are you trying to translate to Danish?
I’m not sure what you mean by “duplicate” blocks. Can you share a screenshot of this? Uploading Screenshots: https://docs.generatepress.com/article/using-the-premium-support-forum/#uploading-screenshots
March 6, 2023 at 8:20 am #2557616webintas
Hi Fernando,
I think this screenshot will explain: https://www.screencast.com/t/ziD7IPoyR
I am not exactly trying to translate something, it is more the fact that it is not translated yet.
March 6, 2023 at 7:58 pm #2558153Tom
Lead DeveloperLead DeveloperHi there,
Translations need to be made here: https://translate.wordpress.org/projects/wp-plugins/generateblocks/
Once a translation hits 90% (I believe) it can be automatically shipped by WordPress.
Let us know if you have any other questions 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.