Problems Converting to Gutenberg Blocks

Going back to do some work on a few older posts, I decided to “Update” them to blocks with Gutenberg. Unfortunately, any image classes and shortcodes I’ve used disappeared upon conversion. Specifically those with images.

I used the [caption] shortcode and CSS to round my image corners, but after converting to blocks, the CSS class is gone, as is the shortcode.

Is there something I missed? Should I just not convert old posts? Having to go back and re-add the shortcode and CSS to every image is incredibly frustrating.

Note The captions are still there, just changed, all lowercase now. And the CSS class is still there in the HTML, it just isn’t working.

Hi @kerridawn,

Thanks for reaching out.

Would you mind providing a sample URL where this issue is? I’m not sure what you’re converting to Gutenberg blocks. That might not related to the cornerstone but raw shortcodes.

Thanks!

Hey,

It’s not a Cornerstone issue, just a theme shortcode.

Here’s an example of a post I haven’t converted to blocks:

This is an example of the shortcode that gets messed up when converting:

[caption align=“alignnone” width=“1000”] Caption [/caption]

Hi There @kerridawn

Gutenberg has it’s own style of shortcodes that you need to follow. Please check the exmple below.

<figure class="wp-block-image"><img src="https://testcloud.asia/demos/poolmates/wp-content/uploads/2018/11/Icon-5.png" alt="" class="wp-image-255"/><figcaption>This is Caption</figcaption></figure>

If you want to use Gutenberg with existing shortcodes, please follow the resources below.

Hope that helps.

Yeah, their new style of shortcodes are what caused the problem. I guess I’ll just avoid changing any old posts to blocks in the future.

Thanks for the links though, I found the option to add a shortcode block so I could still use the Themeco ones.

You’re welcome! :slight_smile:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.