I'm new to wordpress, but I'm a pretty competent developer. I'm trying to nail down what my client can do to their site. My idea was to create some special 'blocks' for them, which provide the page sections they need with minimal editing requirements.
I know you can create custom blocks with a plugin, but can I create them as part of a theme? If so, can anyone provide me with a link to some helpful information about how to do it?
How would one remove the custom block when the theme is deactivated?
Thanks in advance.
I'm new to wordpress, but I'm a pretty competent developer. I'm trying to nail down what my client can do to their site. My idea was to create some special 'blocks' for them, which provide the page sections they need with minimal editing requirements.
I know you can create custom blocks with a plugin, but can I create them as part of a theme? If so, can anyone provide me with a link to some helpful information about how to do it?
How would one remove the custom block when the theme is deactivated?
Thanks in advance.
Since you don't explain what functionality you're trying to achieve, I assume you want to do one of these thing.
If you're going to put that block in the post content you can achieve that by using WordPress shortcode
If you're going to use that block as part of the layout, you might want to use custom widgets instead.
And both of them can be coded as a standalone plugin or coded in the theme as well. Putting it as a separate plugin means that the user needs to deactivate the plugin if he/she wants to remove the functionality, and if you put it in the theme code, the functionality will just disabled when the theme is deactivated.\
I hope that helps.