admin管理员组文章数量:1127085
My WordPress site uses the following:
- Header.php file from the theme.
- Footer.php file from the theme.
- Apart from the Posts Page, the rest of the site makes use of Gutenberg blocks (not header or footer area).
- The posts page uses the site's index.php file at wp-content/themes/meow/index.php
When I updated the site to 5.9, the posts page no longer looked the same. I checked what file loads when the posts page is viewed in the browser:
- Before the update to 5.9, the site loads: wp-content/themes/meow/index.php.
- After the update, the site loads: wp-includes/template-canvas.php
I thought WordPress was supposed to be future-proof. How can I make use of index.php, instead of template-canvas.php, when the site is updated to 5.9?
My WordPress site uses the following:
- Header.php file from the theme.
- Footer.php file from the theme.
- Apart from the Posts Page, the rest of the site makes use of Gutenberg blocks (not header or footer area).
- The posts page uses the site's index.php file at wp-content/themes/meow/index.php
When I updated the site to 5.9, the posts page no longer looked the same. I checked what file loads when the posts page is viewed in the browser:
- Before the update to 5.9, the site loads: wp-content/themes/meow/index.php.
- After the update, the site loads: wp-includes/template-canvas.php
I thought WordPress was supposed to be future-proof. How can I make use of index.php, instead of template-canvas.php, when the site is updated to 5.9?
Share Improve this question edited Feb 22, 2022 at 19:46 Denby101 asked Feb 22, 2022 at 19:32 Denby101Denby101 1011 bronze badge 3 |2 Answers
Reset to default 1Thank you for the solution, but this one is better than hacking the core files you can use this code in your functions.php to disable block theme support
function action_remove_block_templates()
{
remove_theme_support('block-templates');
}
add_action('after_setup_theme', 'action_remove_block_templates', 15);
this happens because wp_enable_block_templates() is enabled. Try to navigate to wp-includes/theme-templates.php and comment that function, its placed at the end of the file.
Let me know if it worked, good luck!
本文标签:
版权声明:本文标题:After updating to 5.9, when the posts page is loaded in the browser it uses wp-includestemplate-canvas.php? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736693987a1948082.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
example.com/hello-world
only (i.e. other pages like category archives and search results pages are not using thetemplate-canvas.php
)? Also, "I checked what file loads" - how did you check? Try adding a dummy text (e.g.test123
) to theindex.php
file and see if the text is showing on the single post pages? – Sally CJ Commented Feb 24, 2022 at 2:13