Block Theme customisation
-
I’m picking up WordPress and trying to dive in with Blocks and themes. I am trying to integrate The Event Calendar (TEC) into the Fork (block editor) theme and have got confused. I understand most of how to do what I want in the Block Editor.
TEC has blocks and does some of what I want but I wanted to tidy up the display of the data. It suggests using hooks for certain customisations and has some code examples. TEC has template overrides in the tribe folder under the template, so seems to be isolated from template updates.
I’d started off deciding that as I was using Blocks I didn’t need a child template, so merrily did some experimentation in Fork. As I understand it the customisation is stored in the database.
However, if I want to use hooks, I presume that goes in functions.php
But, now I am bothered because I don’t want to update functions.php in Fork.
As a general point, I’m a bit confused under the Site Editor where you put PHP code if you want to add functionality without altering the template itself.
As a workaround, I thought I would create a child theme from Fork so I created Fork-child using the Create Block Theme and then I’ve got a place to alter functions.php, but that seems to have broken the site as the header and footer appear in the editor (and can be edited) but do not display on the Visit site option (they reappear if I flip the site template back to Fork). That might be a different point and really what I want is a minimally edited site with as little customisation as possible, preferably without child themes if possible.
So the simple question is in the Block Editor, what is the correct way to add PHP code for actions like the TEC plugin filter code?
- The topic ‘Block Theme customisation’ is closed to new replies.