This post was created using Gutenberg, the new editor, coming soon, for WordPress. You can learn more about it here, try the Beta plugin or simply try it out for yourself, no site required.

The brand-new, all-singing, all-dancing, editor for WordPress is due imminently and I've been using the beta version for some time for creating posts on this site. Recently you may have noticed a little advertisement of this fact has appeared at the top of (some of) my posts – I've added this to help promote Gutenberg.

Let me share the code I've used to do this…

This uses a Gutenberg function to see if any blocks exist in the current post. If so, and this is a single post, it will then add a simple text box to the top of the content. Obviously, please style the message box to taste.