Title: Block Theme Pattern Registration
Last modified: August 28, 2024

---

# Block Theme Pattern Registration

 *  Resolved [kracked888](https://wordpress.org/support/users/kracked888/)
 * (@kracked888)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/block-theme-pattern-registration/)
 * Hey guys, I’m building a child theme and trying to use the built in WP functionality
   to register my custom template-parts by placing them in the /patterns directory
   of my child theme.
 * However, after doing this, the new patterns don’t display as options in the Site
   Editor UI or in Appearance / Editor / Patterns.
 * The ONLY way I’ve been able to get them to register / display is by deactivating
   the child theme, switching to another theme, then reactivating the child theme.
   Once I did this, the patterns appear as expected.
 * I couldn’t find any mention of it in the Theme Handbook -> [https://developer.wordpress.org/themes/patterns/registering-patterns/](https://developer.wordpress.org/themes/patterns/registering-patterns/)
 * Is this behaviour to be expected?
 * Paul

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Mohd Javed](https://wordpress.org/support/users/jawedrs/)
 * (@jawedrs)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/block-theme-pattern-registration/#post-17995844)
 * Hi Paul,
 * Thanks for sharing the details about your issue. It sounds like the pattern registration
   is working, but the child theme isn’t triggering the pattern refresh immediately
   in the UI.
 * This behavior is not typical and shouldn’t require theme switching to make the
   patterns appear. Here are a few things you could try:
    1. **Clear cache**: Sometimes WordPress or your browser may cache the theme files,
       causing changes not to appear immediately. Try clearing both WordPress and browser
       caches.
    2. **Check `theme.json` file**: Ensure your `theme.json` (if you have one) includes
       proper configuration for patterns, as it might influence their visibility in
       the editor.
    3. **Use the `register_block_pattern()` function**: If you’re comfortable with 
       some PHP, you can manually register patterns using the `register_block_pattern()`
       function in your child theme’s `functions.php`. This ensures patterns are registered
       every time the theme is activated.
 *     ```wp-block-code
       register_block_pattern(    'my-child-theme/my-pattern',    array(        'title'       => __( 'My Custom Pattern', 'my-child-theme' ),        'description' => _x( 'A custom pattern for my theme', 'Block pattern description', 'my-child-theme' ),        'content'     => '<!-- wp:group --> ... <!-- /wp:group -->',    ));
       ```
   
 * **Theme switching workaround**: If the theme switch is consistently working, 
   it could indicate a loading or refresh issue within the child theme. Investigating
   further may help pinpoint if something in the theme files is delaying the registration.
   
   Hope this helps! Let me know if you need further clarification or assistance.
 *  Thread Starter [kracked888](https://wordpress.org/support/users/kracked888/)
 * (@kracked888)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/block-theme-pattern-registration/#post-17995891)
 * Thanks Mohd Javed,
 * I ended up setting the Development Mode to ‘theme’ in wp-config.php and that 
   seems to have done the trick in busting the theme caching.
 * define( ‘WP_DEVELOPMENT_MODE’, ‘theme’ );
    - [https://make.wordpress.org/core/2023/07/14/configuring-development-mode-in-6-3/](https://make.wordpress.org/core/2023/07/14/configuring-development-mode-in-6-3/)
    - [https://github.com/WordPress/create-block-theme/issues/431](https://github.com/WordPress/create-block-theme/issues/431)
 * Regards
   Paul

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Block Theme Pattern Registration’ is closed to new replies.

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 3 replies
 * 2 participants
 * Last reply from: [kracked888](https://wordpress.org/support/users/kracked888/)
 * Last activity: [1 year, 8 months ago](https://wordpress.org/support/topic/block-theme-pattern-registration/#post-17995891)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
