-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Patterns from the pattern directory do not show if placed in a template #64104
Comments
Hi @carolinan , I tested this locally as you suggested. It seems the issue is that the 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: Env` ### wp-core ###version: 6.6.1 wp-paths-sizeswordpress_path: /Users/carolina/LocalSites/66/app/public wp-active-themename: Twenty Twenty-Four (twentytwentyfour) wp-themes-inactive (16)child: author: Anonymous, version: (undefined), Auto-updates disabled wp-plugins-inactive (5)Create Block Theme: version: 2.3.0, author: WordPress.org, Auto-updates disabled wp-mediaimage_editor: WP_Image_Editor_Imagick wp-serverserver_architecture: Darwin 23.5.0 x86_64 wp-databaseextension: mysqli wp-constantsWP_HOME: undefined wp-filesystemwordpress: writable ` |
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 |
Hi, |
This may help someone: in Twenty Twenty-Five, if you add a pattern in the /patterns folder, it won't show up anywhere. Go to Tools -> Edit Themes, the pattern will show in the Theme Files pane. Select it and click 'Update file' - the pattern becomes available |
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.
The text was updated successfully, but these errors were encountered: