0

I'm fairly new to WP dev and I'm trying to work out the best method to include reusable sections/templates within the page content added within the page editor. I have included an image to illustrate what I mean:

enter image description here

The content highlighted in green is added to the page via the editor. What I want to know is, how do I split up those sections with reusable sections/includes. Obviously, I can just added the markup into the page content but I assume there is a much better way of doing it?

I have been reading about shortcodes, is that the best way to approach this? If correct, I guess the best way would be to create template partials (or whatever the correct term is) for each reusable section, then create shortcode functions for them in the functions.php. Then add them to the page content using shortcodes?

Hope this makes sense.

Thanks

2
  • I would create a gutenberg bloc, which then you can use as a reusable bloc, what excatly do you want to have inside those blocs ? – lucrece Mar 10 at 10:19
  • Hi, thanks. They are just blocks of content (html, images) like CTAs, feature lists, faqs etc) that might be included in other pages. Did you mean Gutenberg block? – Burns Mar 10 at 10:26
1

I think you should to take a look at the gutenberg bloc.

This is not simple at the first approach, but I think you should take a look at it (even if you want to use some plugin to help you)

See the doc : https://developer.wordpress.org/block-editor/

enter image description here

enter image description here

3
  • Yes, thanks thats kind of what I was looking for. Thanks – Burns Mar 10 at 11:16
  • You should take a look at block lab for wordpress (it helps you to create you gutenberg bloc). It's free, but there's a premium version of it. Personaly, I'm using ACF pro (which combine the ACF power to the gutenberg bloc) – lucrece Mar 10 at 11:23
  • Thank you, I will take a look. – Burns Mar 10 at 11:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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