【问题标题】:Why can''t I see my custom template when creating new page?为什么我在创建新页面时看不到我的自定义模板?
【发布时间】:2019-09-06 10:42:31
【问题描述】:

我刚刚开始了解 WordPress 模板。

我制作了一个名为“attribute_information_popup.php”的非常简单的模板,并将其放在我的子主题中的文件夹“page_templates”中。

<?php 
/* 
 * Template Name: Attribute Information Popup Page
 * description: Template for making pages used in the product attributes information popup.
 */ 
?>

<h1>test</h1>`

当我进入“创建页面”时,我没有在页面编辑器右侧的“页面属性”部分的下拉列表中看到我的模板。

【问题讨论】:

标签: wordpress templates child-theming


【解决方案1】:

首先,您不需要在子主题中创建任何文件夹。这不是强制性的。其次,检查是否激活了相同的主题。我的意思是我曾多次遇到同样的问题。我没有在下拉菜单中看到该页面。然后我看到我已经激活了父主题。然后我激活了子主题,我的问题就解决了。

【讨论】:

  • 感谢 STBox,我检查了,子主题处于活动状态。还是一样的问题
  • 我尝试将模板放在子主题的根目录下,在文件夹“page-templates”和文件夹“page_templates”中,没有任何变化
猜你喜欢
  • 1970-01-01
  • 2012-09-10
  • 2019-10-27
  • 1970-01-01
  • 2013-11-13
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多