更新时间:2021-12-09 21:28:44
我无法通过全新安装的 WordPress 3.3.1 复制您所看到的内容.我有一个只有两个文件的主题,style.css
,包含:
I can't duplicate what you're seeing with a clean install of WordPress 3.3.1. I have a theme with just two files, style.css
, containing:
/*
Theme Name: ***-8946077
Template: twentyeleven
Version: 0.0.1
*/
@import url("../twentyeleven/style.css");
和coming-soon.php
,包含:
<?php
/*
Template Name: Coming Soon
*/
get_header();
?><h1>Coming Soon</h1><?php
get_footer();
?>
其中的第一部分是从您的问题中复制的.
the first part of which was copied from your question.
我看到了预期的模板:
我唯一能想到的就是仔细检查:
The only things I can think of are to double-check:
twentyeleven
目录中,它应该可以工作)twentyeleven
目录中没有同名的文件,(我认为)优先.php
模板名称:
)twentyeleven
directory)twentyeleven
directory, which (I think) would take precedence.php
Template Name:
)否则,下拉列表由 wp-admin/includes/theme.php
中的 get_page_templates
函数填充.可能值得在其中粘贴一些调试代码,以查看 $templates
变量是否包含 coming-soon.php
.
Failing that, the dropdown is populated by the get_page_templates
function in wp-admin/includes/theme.php
. Might be worth sticking some debug code in there to see if the $templates
variable includes coming-soon.php
.