admin管理员组文章数量:1125924
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.
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.
Share Improve this question edited May 17, 2023 at 20:25 nicknoop asked May 17, 2023 at 20:04 nicknoopnicknoop 113 bronze badges 3- The ability to do this was broken in 6.2.1: wptavern.com/… Whether it's restored is still an open question. – Jacob Peattie Commented May 18, 2023 at 7:31
- Thanks @Jacob Peattie – nicknoop Commented May 18, 2023 at 8:07
- Anyone stumbling onto this, here is a temp solution: core.trac.wordpress.org/ticket/58333#comment:7 – nicknoop Commented May 18, 2023 at 9:29
2 Answers
Reset to default 2This was a bug introduced in WordPress 6.2.1, and was resolved in WordPress 6.2.2.
Still a bug in some cases: https://github.com/WordPress/gutenberg/issues/35258
Places where shortcodes aren't working:
wp:pattern
wp:template-part
本文标签: full site editingUsing lt wpshortcode gtmyshortcodelt wpshortcode gt in FSE template file
版权声明:本文标题:full site editing - Using <!-- wp:shortcode -->[my_shortcode]<!-- wp:shortcode --> in FSE template f 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736656567a1946270.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论