开发者

Wordpress hierarchy breaking (3.1.2)

开发者 https://www.devze.com 2023-03-06 01:43 出处:网络
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....

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 strai开发者_开发百科ght 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?


Not sure why that would happen, but have you tried naming your custom template file page-yourpageslug.php or page-yourpageid.php. Wordpress should use that template by default without having to set it that way in the admin area.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号