full site editing – Using [my_shortcode] in FSE template file


Does anyone know how I can insert a shortcode directly into a FSE template file, e.g. my-theme/templates/page-contact.html?

I have been trying [my_shortcode], but it does not seem to work.

If I try to add the shortcode to the template via the Appearance > Editor > Templates > page-contact it also does not work. However, if I add the shortcode directly into the page content, i.e. Pages > Contact and insert a shortcode block, then the shortcode [my_shortcode] works fine in the page.

I have the latest version of WP, currently 6.2.1. Working locally with Local By Flywheel.

I hope this makes sense, it has been rather puzzling to say the least as it was previously working. Tried all kinds of things like deactivating all plugins, using default twentytwentythree theme, etc, etc.

Many thanks for consideration.

nicknoop 2 weeks 2023-05-17T15:04:12-05:00 0 Answers 0 views 0

Leave an answer