Open carolinan opened 1 month ago
Hi @carolinan ,
I tested this locally as you suggested. It seems the issue is that the home.html
is already saved in the database with its initial structure, which is why the pattern isn't visible on the frontend. If you edit and save the page, the pattern should appear.
Additionally, you can create a separate page template that includes the pattern to see if it displays correctly on the initial load.
I have already made sure that there are no changes to any templates saved in the database. And I included that as part of step 3 in the testing instructions.
If I create a new page or template using the Site Editor and then insert the about page pattern on template creation, then yes, as I wrote in the issue, then the pattern works, it is technically "inserted" when the pattern is selected in the modal.
When the template is created as a HTML file with the pattern as part of the markup, it does not show on the front.
If these steps work for you, then maybe we are on different environments?
Edit: Added info from Site Health:
I'm not sure if it's relevant, but I wanted to report also the following bug on a fluid theme:
If I add a new pattern in the pattern directory, it doesn't show in the block search, unless I delete the relevant transient (_site_transient_wp_theme_files_patterns-xxxx) in the options or define the 'WP_DEVELOPMENT_MODE', to 'theme', which of course is off on production sites.
I'm not sure if it's relevant, but I wanted to report also the following bug on a fluid theme:
If I add a new pattern in the pattern directory, it doesn't show in the block search, unless I delete the relevant transient (_site_transient_wp_theme_files_patterns-xxxx) in the options or define the 'WP_DEVELOPMENT_MODE', to 'theme', which of course is off on production sites.
This should be raised as a bug -- I just spent an hour trying to figure out why my custom patterns were not showing in the block picker. Deleting this DB row was the solution. TY @margarita-boomCodes
Description
I encountered this in a custom theme but I can also reproduce it with Twenty Twenty-Four, with no plugins installed. I only tested on WP 6.6.1.
Twenty Twenty-Four enables these two patterns from the pattern directory in theme.json:
The theme then uses the clients section pattern inside twentytwentyfour/page-about-business.
When I create a new page and select the "About" business pattern, the remote pattern displays correctly in both the editor and front.
But if I edit a template HTML file and include the clients section or any other pattern from the pattern directory, the pattern only shows in the editor.
Step-by-step reproduction instructions
These example instructions uses Twenty Twenty-Four, but it can be reproduced in other block themes.
define( 'WP_DEVELOPMENT_MODE', 'theme' );
For example in wp-config.php.<!-- wp:pattern {"slug":"clients-section"} /-->
Screenshots, screen recording, code snippet
No response
Environment info
WordPress 6.6.1.
Please confirm that you have searched existing issues in the repo.
Please confirm that you have tested with all plugins deactivated except Gutenberg.