Importing Google Fonts in Block Themes — Correct Way

Make sure the layout.css file is called correctly, both on the frontend and backend. No need to add fontFace, you have called it via @import : { “$schema”: “https://schemas.wp.org/trunk/theme.json”, “version”: 3, “settings”: { “layout”: { “contentSize”: “700px”, “wideSize”: “1200px” }, “typography”: { “fontFamilies”: [ { “fontFamily”: “\”PT Sans\”, sans-serif”, “name”: “PT Sans”, “slug”: “pt-sans” }, … Read more

How to include block style variations for blocks in posts dynamically rendered via the Interactivity API

Block variation styles are parsed and processed through wp_render_block_style_variation_support_styles(). This is marked as private and thus should not be called by third-party code outside WordPress core. This function is called by virtue of being hooked into the render_block_data hook. Thus, if you have a subset of known block structures that may appear, you could consider … Read more

set allowedBlocks to a specific variant

First: It is impossible allowedBlocks only accepts block names as strings — not specific variations or object definitions. Second: What’s the correct approach? Use the base block name, then define the variation via className or attributes in the template. How to find a variation’s className? Insert the block (e.g., core/group) and select the desired variation. … Read more

Custom Gutenberg blocks not showing in WP editor

The import syntax only works if you are using a build system (the npm/npx stuff). If you don’t want to use that right now, you can replace the import with wp.<module> like: const { registerBlockType } = wp.blocks; registerBlockType(‘custom-blocks/simple-block’, { edit: () => ‘abc’, save: () => ‘abc’ }); Or directly like: wp.blocks.registerBlockType(‘custom-blocks/simple-block’, { edit: … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)