Custom block help

[ad_1]

Hi all,

New to WordPress but experienced with HTML,CSS, JS and PHP. I’m developing a custom block theme and have run into a roadblock with some tricky (for me) functionality.

I’d like to have 2 buttons with some text content underneath. The text content would change depending on which button is active/clicked. It can all be hard-coded but I’d like to eventually extend it to be able to add x buttons and x text content, but that’s well out of my wheelhouse for now. My question is what would the workflow for something like this look like for you?

My understanding is I can:

1. Create a custom block within the theme. I understand this method isn’t officially supported by WP as changing themes would break that functionality?

2. Use create-block to build it in the top level plugin directory and work through the official dev docs to figure it out.

3. Add custom html in fse and some JS to get it working. This seems like the easiest method for me but feels like it’s just bypassing WP entirely and I wouldn’t actually learn anything.

If anyone could offer some insight or steer me towards some relevant docs that would be great.

Thanks

[ad_2]

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer