I am editing a wordpress theme and I figured out editing the html with the <wp:pattern
annotations etc but I’m having a few issues.
- If I edit using the editor UI, any further HTML changes don’t take effect
- Creating my own custom pattern registers fine but no changes take effect after that
- Some blocks appear fine in the front end, but ‘Attempt Group recovery’ message gets shown to me in the editor UI
I will attach some snippets of my code for reference but is there any decent documentation for this or do you literally have to struggle until something starts working?
This is the block that needs recovering but seems fine in the front end
<?php
/**
* Title: Right navigation
* Slug: test/right-navigation
* Inserter: no
*/
?>
<div class="navigation right">
<?php
wp_nav_menu(["Right Navigation"]);
?>
</div>
This pattern shows up in the Banner section of the patterns in the editor ui, but when I add banner-custom
class, it never gets added
<?php
/**
* Title: Banner Custom
* Slug: test/banner-custom
* Categories: banner
*/
?>
<!-- wp:group {"align":"full","layout":{"type":"constrained","contentSize":"","wideSize":""},"className":"banner-custom"} -->
<div class="wp-block-group alignfull banner-custom">
<!-- wp:image {"align":"wide","sizeSlug":"full","linkDestination":"none"} -->
<figure class="wp-block-image alignwide size-full">
<img src="<?php echo esc_url( get_template_directory_uri() ); ?>/assets/images/test.jpeg" alt="<?php esc_attr_e( 'Motherboard', 'test' ); ?>" />
</figure>
<!-- /wp:image -->
</div>
<!-- /wp:group -->
The documentation for this so far seems very poor and it’s so frustrating 🙁