On this page:
I’m attempting to write a WordPress (WP) theme. It seems that the Gutenberg block system is here to stay (see the release notes for WP 5.9), so my theme, which was going to be what is now called a classic theme, is going to be a block theme.
Block themes are new, so I don’t know how to do them; naturally, I looked on the internet for documentation. However, the documentation that is there is either out-of-date (referring to WP 5.8 and/or the Gutenberg plugin) or completely useless.
I started following WP’s guide to set up a development environment, but it seemed inanely complicated, requiring Node and NPM, Docker. I couldn’t understand why I needed all these things or why it made so much fuss about having NVM, so, after creating a free account at Docker, I gave up and set up Apache, MySQL and PHP locally, which works perfectly well. I already have Node and NPM installed, so that shouldn’t be a problem (🤞).
I’m going to document the things I find out here; field notes on blocks, if you will, which I hope will be more useful than WP’s own field guide.
Site Editor
I’ve just realised something about WordPress block styling, and it’s not good
I realise that semantic classes are not compatible with the Site Editor’s settings.
Adding a navigation menu to a WordPress block theme
I work out how to register menu locations for themes, which seems pointless, actually.
WordPress block settings: I’ve found them
I finally find some answers to my block markup questions.
Blocks
Panda-Puss base theme change
I change the type of my Panda-Puss theme from a traditional one to a new-fangled block theme.
WordPress block template documention
I look for documentation to help with creating my WordPress block theme Panda-Puss.
There’s a Sublime Text package to auto-complete WordPress blocks
I have an idea for helping with WordPress block templates: an auto-completion package for Sublime Text.
WordPress block template markup: types of tag
There are two types of WordPress block template markup, just as there are two types of HTML tags. I explain.
Adding your own classes to WordPress blocks
I find out how to add classes to WordPress blocks without breaking the WordPress editor.
WordPress navigation blocks
I discover how to add a navigation block to a WordPress block theme. I note some of the markup that can be used with such blocks.
WordPress block parts
I talk briefly about WordPress block theme parts and compare them to the classic theme equivalent.
I’ve just realised something about WordPress block styling, and it’s not good
I realise that semantic classes are not compatible with the Site Editor’s settings.
WordPress search block and search results
The lack of conditional logic in HTML files is causing problems. This problem doesn’t exist with PHP files.
Adding a navigation menu to a WordPress block theme
I work out how to register menu locations for themes, which seems pointless, actually.
WordPress block settings: I’ve found them
I finally find some answers to my block markup questions.
WordPress search block and search results: improved
WordPress 6.0 improves the behaviour when no results are found.
Patterns
Patterns were originally called block patterns; not all WP themes and documentation on the internet have been updated.
WordPress search block and search results: improved
WordPress 6.0 improves the behaviour when no results are found.
Templates
Templates were originally called block templates; not all WP themes and documentation on the internet have been updated.
WordPress block template documention
I look for documentation to help with creating my WordPress block theme Panda-Puss.
There’s a Sublime Text package to auto-complete WordPress blocks
I have an idea for helping with WordPress block templates: an auto-completion package for Sublime Text.
WordPress block template markup: types of tag
There are two types of WordPress block template markup, just as there are two types of HTML tags. I explain.
Adding your own classes to WordPress blocks
I find out how to add classes to WordPress blocks without breaking the WordPress editor.
WordPress navigation blocks
I discover how to add a navigation block to a WordPress block theme. I note some of the markup that can be used with such blocks.
WordPress block parts
I talk briefly about WordPress block theme parts and compare them to the classic theme equivalent.
WordPress search block and search results
The lack of conditional logic in HTML files is causing problems. This problem doesn’t exist with PHP files.
WordPress search block and search results: improved
WordPress 6.0 improves the behaviour when no results are found.
Parts
Parts were originally called template parts; not all WP themes and documentation on the internet have been updated.
WordPress block parts
I talk briefly about WordPress block theme parts and compare them to the classic theme equivalent.
Adding a navigation menu to a WordPress block theme
I work out how to register menu locations for themes, which seems pointless, actually.
WordPress search block and search results: improved
WordPress 6.0 improves the behaviour when no results are found.