Advertising Gutenberg use on your website

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.

Posted by David Artiss

Enterprise Happiness Engineer for the WordPress VIP team at Automattic. Gamer, film lover and general fan of all things Marvel, Star Trek and Star Wars. Failed comedian. Writer for The Big Tech Question. World's Greatest Grandma.

Talk to me!

This site uses Akismet to reduce spam. Learn how your comment data is processed.