admin管理员组文章数量:1125422
Update: As with so many mysteries, the cause turned out to be extremely stupid. I had the file saved in a different theme's directory. Thanks to @a4jp
I'm building a theme using underscores. I've created a template file and added a template header at the top.
<?php
/**
* Template Name: Featured
**/
get_header(); ?>
I'm not getting a Template drop down under Page Attributes in the page editor, so I'm not sure if there's a problem with my formatting or something else.
I did try switching themes. The drop down appears in the other theme, but when I switch back to my custom theme, it's still missing.
Update: As with so many mysteries, the cause turned out to be extremely stupid. I had the file saved in a different theme's directory. Thanks to @a4jp.com
I'm building a theme using underscores. I've created a template file and added a template header at the top.
<?php
/**
* Template Name: Featured
**/
get_header(); ?>
I'm not getting a Template drop down under Page Attributes in the page editor, so I'm not sure if there's a problem with my formatting or something else.
I did try switching themes. The drop down appears in the other theme, but when I switch back to my custom theme, it's still missing.
Share Improve this question edited Apr 14, 2015 at 12:59 Thomas Martin asked Apr 13, 2015 at 19:39 Thomas MartinThomas Martin 2392 gold badges3 silver badges11 bronze badges 4 |6 Answers
Reset to default 9Maybe this will help.
<?php
/*
Template Name: Featured
*/
get_header(); ?>
Regular code here...
<?php get_footer(); ?>
If one theme works you could try replacing the files in the broken theme and test which file or files are broken. But first save the old files in a separate folder as a backup. Then you would know which file or files are broken pretty quickly.
By default Wordpress theme directory have not any template page then template page dropdown is invisible so follow the below instruction.
For display template page dropdown in wordpress admin page you need to create one template page in your theme directory code is below
<?php
/*
Template Name: template home
*/
?>
By creating this template file in your theme directory you can see template dropdonw is visible in admin page.
If you're not seeing the dropdown at all you might need to reload your theme. Try switching to another theme and then switching back.
This has happened two times for me. At the first time I changed the encoding of the file (header.php I think) to UTF-8 without BOM and all templates disappeared. Changed it back to regular utf-8.
At the second time I somehow edited/renamed the index.php (/themes/theme_name/index.php). Just had to create an empty index.php and now everything seems to be ok.
I hope this helps someone else. [WP 4.4.2]
I had this same issue today, not sure if its relevant but for me the fix was, go to the edit page section, expand screen options, page attributes was not ticked, ticked it and the template dropdown came back.
For the page template select/dropdown to appear in my custom theme (Block theme) I had to add the following in theme.json for each custom page template.
"customTemplates": [
{
"name": "home",
"title": "Home"
}
],
本文标签: Page editor missing Templates drop down
版权声明:本文标题:Page editor missing Templates drop down 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736657264a1946287.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
page-
prefix for page templates. Before 3.4 this was the only way to name page templates. Now you don't have to use this naming convention for page templates, although thepage-
prefix is still totally valid – Pieter Goosen Commented Apr 14, 2015 at 4:31