新页面/模板;t在主题进行回退时出现.为什么?


New pages / templates don't appear as the theme goes for a fallback. Why?

我正试图在2015 Wordpress默认主题的基础上设置一个自定义主题。

我已经仔细遵循了几个网站上的说明。即:

  • 在主题的根目录(page.php所在的位置)中创建一个自定义文件。命名为fe。,seoContent.php
  • 打开空白文件,将以下示例代码粘贴到其中:https://36bvmt283fg61unuud3h7qua-wpengine.netdna-ssl.com/wp-content/uploads/2008/08/page-seo-example.txt
  • 转到管理面板,然后页面->添加新内容,从侧边栏的模板下拉菜单中选择SEO内容页面
  • 已发布页面

当我转到该页面时,无论我如何修改seoContent.php文件,它的特定内容都不会出现。页面总是显示相同的索引页面(我认为page.php内容在根目录中)。为什么?这是带有if条件的某种回退吗?

即使我去/wp_project_name/index.php/seoContent.php查看新页面,它也不会。为什么?

任何形式的帮助或暗示都非常感谢!

EDIT_1:该项目位于WAMP的本地主机上。

我会尝试这样做:打开您当前的主题目录根文件夹,打开page.php文件并保存为page-SeoContent.php。替换顶部的注释区域-应该看起来像:/** * The template for displaying pages * * This is the template that displays all pages by default. * Please note that this is the WordPress construct of pages and that * other "pages" on your WordPress site will use a different template. * * @package WordPress * @subpackage Twenty_Sixteen * @since Twenty Sixteen 1.0 */

使用所附样本中的模板名称: /* Template Name: SEO-Content-page */然后在<!--- SMO TABLE ---><!--- CLOSE SMO TABLE --->,并粘贴到新的page-SeoContent.php文件中。这里的内容是纯html,所以请确保不要将其复制到php部分。这样就可以了。仅供参考,您正在尝试创建一个新的模板,而不是一个新主题。这至少应该让追踪任何其他问题变得更容易。