1

I am looking for a way for users (who will be site admins) to design Blocks that will be used by a plugin I am developing. I want the solution to work in both Classic and Block themes, so I have been exploring the support for Template Part Blocks in Classic themes.

This is working, and when I go to Appearance / Template Parts, the existing Template Parts I have defined can be edited. However there is no option to add a new Template Part. It appears that the only way to add one is to put a .html file into the file system. Note that at present I am adding these files to my Theme folder, but I have found a solution that will allow them to be added to my Plugin folder, I just haven't implemented this yet.

Is there a way to allow users to create new Template Parts in Classic Themes without creating a file manually?

I have considered providing an option on one of my admin screens to create a new file for the Template Part, which the user could then update with the editor, but I am concerned that these files would be lost when the plugin is updated.

1 Answer 1

1

According to Carolina's excellent reference on full site editing, hybrid themes (that use both PHP and block template parts) can only allow users to add new template parts if you activate the Gutenberg plugin.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.