customization - Custom Blocks as part of a theme

admin2025-06-03  3

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.

Share Improve this question asked Feb 20, 2019 at 0:32 RichardRichard 1835 bronze badges
Add a comment  | 

1 Answer 1

Reset to default -1

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.

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1748887520a314550.html

最新回复(0)