wordpress:header.php 和 footer.php 的默认位置
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12391486/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
wordpress: default location of header.php and footer.php
提问by Jules Colle
Here's a really simple question. I have wordpress 3.4.2 installed. I'm trying to build a theme from scratch. So I've added a style.css file and an index.php file. Both only containing the bare minimum. Now I'm wondering when I call the get_header() and get_footer() functions from index.php, where are the header.php and footer.php files located that wordpress is using to generate the header and footer of my site?
这是一个非常简单的问题。我安装了 wordpress 3.4.2。我正在尝试从头开始构建一个主题。所以我添加了一个 style.css 文件和一个 index.php 文件。两者都只包含最低限度。现在我想知道当我从 index.php 调用 get_header() 和 get_footer() 函数时,wordpress 用来生成我网站的页眉和页脚的 header.php 和 footer.php 文件在哪里?
采纳答案by Jules Colle
Found the answer here: http://codex.wordpress.org/Function_Reference/get_header. It seems the default header.php and some other template files are in wp-includes/theme-compat/
在这里找到答案:http: //codex.wordpress.org/Function_Reference/get_header。似乎默认的 header.php 和其他一些模板文件在 wp-includes/theme-compat/
回答by RedEyedMonster
In the root folder of your wordpress theme e.g. wp-content/themes/mytheme so you will have to create these also ...
在你的 wordpress 主题的根文件夹中,例如 wp-content/themes/mytheme 所以你也必须创建这些......

