[Resolved] Use generate_settings container_width for Gutenberg Editor

Home Forums Support [Resolved] Use generate_settings container_width for Gutenberg Editor

Home Forums Support Use generate_settings container_width for Gutenberg Editor

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #1590885
    David Perez Garcia

    Hello,
    It should be nice that some things from frontend should go to the Gutenberg Editor. Like generate_settings – container_width, typography…

    How could I do it? or Are you planning to put it in nexts versions?

    #1590887
    David
    Staff
    Customer Support

    Hi there,

    GP already does that by default, check that you have Use Theme Styles enabled, you will find this in the editor 3 dot menu ( top right ) > Preferences > Appearance.

    If that is enabled and you are still not seeing the styles then another function or plugin is disabling that.

    #1591770
    David Perez Garcia

    Yes, ok I do and is activated.

    But my container in editor still in 1470, but my container in customizer is 1000px.

    #1592414
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    It’s hard to tell without seeing it, but it could be another plugin altering the width of the content.

    Can you link us to the front-end of the page in question?

    #1592772
    David Perez Garcia

    It happens in all websites. I share with you one.

    #1593496
    Tom
    Lead Developer
    Lead Developer

    Is there a specific page I should be looking at?

    #1597746
    David Perez Garcia

    Any page. It does not contain the CSS of the theme and the settings of the customizer.

    How could add Additional CSS to Gutenberg Editor?

    #1598631
    Tom
    Lead Developer
    Lead Developer

    You can add the Additional CSS to the editor like this:

    add_action( 'enqueue_block_editor_assets', function() {
        wp_add_inline_style( 'generate-block-editor-styles', wp_get_custom_css_post()->post_content );
    } );
    #1599215
    David Perez Garcia

    Perfect! thanks!

    #1599903
    Tom
    Lead Developer
    Lead Developer

    You’re welcome 🙂

    #1833256
    David Perez Garcia

    Hello Thomas, I get an error with that shortcode:
    Warning: Attempt to read property “post_content” on null

    #1834089
    Leo
    Staff
    Customer Support

    That’s not a shortcode.

    Tom’s function above should be added using one of these methods:
    Adding PHP: https://docs.generatepress.com/article/adding-php/

    Just tested with the Code Snippets plugin and didn’t encounter any error:
    Adding PHP: https://docs.generatepress.com/article/adding-php/

    #1834285
    David Perez Garcia

    I use child theme.

    #1834306
    Elvin
    Staff
    Customer Support

    I use child theme.

    I assume you’ve added it to a child theme’s functions.php ?

    Can you share a screenshot of the error and the contents of the functions.php file?

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