• anubha23

    (@anubha23)


    Dear All,

    I have built a custom theme for this site: https://indianhistorycollective.com and recently, I updated WordPress. New blog posts are being created using Gutenberg blocks. However, these blocks aren’t rendering on the front-end. Even if you centre-align a sentence using the block editor, it doesn’t show up on the front-end. I wish to use Gutenberg for blog posts, if not all post types. What do I add to my theme which will enable me to use Gutenberg for blog posts? Please guide. I have looked at multiple links but nothing is working.

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Vijay Hardaha

    (@vijayhardaha)

    Looks like you’re using a custom theme or a theme that doesn’t have Gutenberg support.

    You need to add Gutenberg support to your theme. for this, you need to add those codes in your functions.php

    add_theme_support( 'responsive-embeds' );
    add_theme_support( 'wp-block-styles' );

    for more detailed information follow this blog https://www.makedo.net/blog/wordpress-website-theme-gutenberg-ready/

    Thread Starter anubha23

    (@anubha23)

    Hey, thanks for this.. Can you please tell me what exactly are Editor Styles? That post has it in the end. Where exactly should that be written?
    Also, is there a way I can enable this just for blog posts?

    Vijay Hardaha

    (@vijayhardaha)

    Editor Styles are for backend editor styling. You don’t need to add custom editor styling if you don’t want to.

    you can just add add_theme_support( 'editor-styles' ); support in theme.

    And once you’ll add Gutenberg support, it will be auto-applied to posts.

    Vijay Hardaha

    (@vijayhardaha)

    Gutenberg support will enable the blocks styles/css that is required for blocks to work properly. right now styles are not loading that’s why the alignment doesn’t work on your website.

    Thread Starter anubha23

    (@anubha23)

    It doesn’t work actually. I had created this theme from scratch many years ago. Will only adding add_theme_support( ‘editor-styles’ ); to functions.php do it? I tried it and it doesn’t work.

    Vijay Hardaha

    (@vijayhardaha)

    add_theme_support( 'responsive-embeds' );
    add_theme_support( 'wp-block-styles' );

    you need to add these lines to enable Gutenberg support as I explained in the first reply.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Gutenberg Blocks Not Outputting’ is closed to new replies.