• I maintain a WordPress site that has posts that I reuse and a number of additional pages. I use some custom HTML to maintain a consistent look and feel across the site. Are there any resources available to guide one through the process of converting classic posts and pages to be compatible with the new editor while maintaining the existing look and feel.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter badrobot

    (@cyouse)

    I think I know the answer but does all of this apply to pages as well as posts?

    Thread Starter badrobot

    (@cyouse)

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.remarpro.com Admin

    There’s probably a few posts and tutorials out there, but really I’ve just winged it on my old posts.

    Here’s what I do:

    1. Open the old post, and see the Classic Block. Switch to the Code Editor (shift-ctrl-alt-M for some reason) to get to the raw HTML code for the post.
    2. Copy that into a local text editor for safe keeping. Just in case something goes wrong. Always a good idea to have a backup plan, even if I do still have revisions to fall back to.
    3. Switch back to the block editor, and select the “Convert to Blocks” option from the Classic Block.

    From here, I then just read through the post and see what might be missing. Mostly I have to convert any code blocks I had into Syntax Highlighter blocks, but for the most part, it tends to get things right. It’s not perfect with floating images, so sometimes I resize them a bit.

    Realistically, the main problem you’re likely to have is if your posts contain complex things like scripting or CSS or extra classes and such. These may be lost in the conversion, which is where that backup comes in handy. And if you had a lot of formatting and site layout contained in the posts themselves, then you’re going to have more problems and may need to move some of that more basic stuff into the theme instead of being inside the post content.

    But here’s the thing: Your old post content is still there, unchanged, until you go edit it. So you don’t need to convert them right away. Instead, try making new posts, entirely in blocks. This will let you see what the blocks do and how they work, and give you a better idea of what you need in the theme to support your look and feel. Then you will be better prepared for converting old content.

    Thread Starter badrobot

    (@cyouse)

    Thanks. I have a whole menu structure exposing a number of pages that have things like google sheets and calendars embedded in iframes, custom html and html pointing to a payment vendor’s javascript. I want to leave the look and feel consistent while gradually converting the posts and pages over the time period where the classic editor plugin is supported.

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.remarpro.com Admin

    For those sections where you convert a post but some of your more unusual HTML doesn’t really seem to fit in the post, remember that there is a Custom HTML block as well. For those pieces, you can simply copy the HTML into one of those blocks, and the editor will leave it strictly alone. So you can continue to use your custom HTML segments in the posts with the new editor, until you find some means to do that better or to replace those.

    Custom HTML is actually much better supported in the new block editor. The classic editor gave you the ability to switch to the text mode and edit the whole thing directly, and the new editor has that as well, but it also has Custom HTML blocks as well as the “Edit as HTML” option on any individual blocks. So that you can use HTML directly where you need it, but use the prettier visual interface for the rest of the post, where you don’t need that level of detailed control.

    Thread Starter badrobot

    (@cyouse)

    Just to follow up – I think the answer is yes but can I assume that this whole block paradigm applies equally to pages as it does to posts?

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.remarpro.com Admin

    Yes, for the default Pages and Posts. Custom Post Types have to specifically opt into it.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Converting an Existing Site to the New Editor’ is closed to new replies.