Gutenberg on an ACF options page

Create a page named as your archive, add blocks there. In archive-name.php please add: <?php get_header(); $page_id = get_post( 57 ); $page = apply_filters( ‘the_content’, $page->post_content ); echo $page; ?> <?php get_footer(); Replace ’57’ with your page ID. Now you can manage content of archive page directly from Pages.

Insert SVG code (not img) in HTML block

I tried this code on a clean install of WordPress <svg width=”100″ height=”100″> <circle cx=”50″ cy=”50″ r=”40″ stroke=”green” stroke-width=”4″ fill=”yellow” /> </svg> and used ‘Custom HTML’ in Guttenberg in a new post. This worked fine for me. The same code displayed in the DOM without deleting any tags or adding any Maybe you cant edit … Read more

Delete a Gutenberg Block Programmatically?

For the original approach – when you delete a forum post, search the database and remove any blocks that refer to that specific post – it looks like the only way to accomplish this would be with a regular expression, which could break in future updates. You could hook into the delete_post hook, verify that … Read more

Use PHP templates as blocks

Block Patterns probably will suit your needs. They’re written in PHP, designed so you can create layouts (like a heading, gallery, and button together) but the content (e.g. what the text of the heading is, etc) is unique each time that you use them. A good overview and roundup of how they’re being used is … Read more

Align Group blocks left or right

OK, I found a way to do this after browsing the source code. I do note that the code that helped me lives under deprecated.js so it’s possible this won’t continue to work. Here’s the JS code I have in my plugin directory function addAlignmentToGroups(settings, name) { if (name !== “core/group”) { return settings; } … Read more