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.