WordPress 层次结构打破 (3.1.2)
我在 WordPress 中有一个页面,其中分配了自定义模板。它最初工作,没有任何通知,有一天决定默认为index.php....
它不会转到它的template_page.php或page.php,它总是直接转到我的主题中的index.php。
我注意到的一件额外奇怪的事情是,在编辑页面时,它不会在发布下方有下拉菜单来选择自定义模板......以前从未见过这种情况。
对于使用自定义模板的此版本中的所有其他页面,情况并非如此。所有其他页面都工作正常。
我尝试过:
- 禁用所有插件/升级插件。
- 更改和重新设置我的永久链接。
- 删除页面并重新创建它。
我发现它偶尔会渲染页面,但并非总是如此。我已经解决了一次并离开了它,几天后它又恢复到尝试使用index.php 来呈现页面。
我很困惑,有什么想法吗?
I've got a page in Wordpress that has a custom template assigned to it. It worked initially and without any notice it one day decided to default to index.php....
It won't go to its template_page.php or to page.php it always goes straight to index.php in my theme.
One extra odd thing i noticed is that when editing the page, it would not have the drop down underneath publish to select the custom template...never seen this before.
This is not the case for every other page i have on this build that uses a custom template. All other pages work just fine.
I have tried:
- disabling all plugins / upgrading plugins.
- changing and re-setting my permalinks.
- deleting the page and re-creating it.
I've found that it will render the page occasionally but not always. I had solved it once and left it and it revert back to trying to use index.php to render the page after a few days.
I'm stumped, any thoughts?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不确定为什么会发生这种情况,但您是否尝试将自定义模板文件命名为
page-yourpageslug.php
或page-yourpageid.php
。 WordPress 默认情况下应该使用该模板,而无需在管理区域中进行这种设置。Not sure why that would happen, but have you tried naming your custom template file
page-yourpageslug.php
orpage-yourpageid.php
. Wordpress should use that template by default without having to set it that way in the admin area.