Block themes typically require separate templates to load different sidebars. The render_block_data filter lets you swap template part slugs at render time based on post category or page context, keeping your template count down. https://developer.wordpress.org/news/?p=6219

Dynamically loading template parts in block themes
Stop duplicating WordPress block theme templates just to load different sidebar content. Learn how to use the render_block_data filter to dynamically swap template parts based on post category, page context, or any conditional logic — no extra templates required.








