• Resolved Difa

    (@difawa)


    Hello guys. I have just read the documentation about theme.json to activate the dimension settings in block editor. The margin setting can show up with no problem, but I don’t know the reason of padding setting is not show up.

    "spacing": {
                "blockGap": null,
                "padding": true,
                "margin": true,
                "customSpacingSize": true,
                "units": [ "px", "em", "rem", "vh", "vw", "%" ],
                "spacingScale": {
                    "operator": "*",
                    "increment": 1.5,
                    "steps": 7,
                    "mediumStep": 1.5,
                    "unit": "rem"
                }
    • This topic was modified 6 months, 1 week ago by Difa.
    • This topic was modified 6 months, 1 week ago by Difa.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter Difa

    (@difawa)

    Why are you talking about the theme.json in wp-includes? You should never customize it. It is part of the WordPress core and is overwritten with every update.

    If you want to make an individual customization, you have to do this in a child theme. See: https://fullsiteediting.com/lessons/child-themes/

    Furthermore: your customizations may not work depending on the theme you are using. This may need to activate support for certain functions separately.

    Thread Starter Difa

    (@difawa)

    Okay, sorry for my mistake. I already installed a child theme but it have no theme.json. I try to make my own theme.json in such theme, but it messed up my post editor.

    Thread Starter Difa

    (@difawa)

    function custom_block_editor_settings() {
        add_theme_support( 'custom-spacing' );
    }
    add_action( 'after_setup_theme', 'custom_block_editor_settings' );

    For anyone look for the same problem, here is the solution to add padding setting to block editor. Put the function in functions.php.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Problem on theme.json in wp-include’ is closed to new replies.