WordPress 调用未定义的函数 get_header(); [英] WordPress call to undefined function get_header();

查看:43
本文介绍了WordPress 调用未定义的函数 get_header();的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,我已经查找了有关此主题的以前的帖子,但没有一个提供我需要的答案.所以我会改写以最适合我的问题.

Firstly, I have looked for previous posts about this topic, but none have the answer that I need. So I shall rephrase to fit my problem best.

我正在尝试创建一个非常基本的 WordPress 主题.我已经获得了我想要的所有模板文件,在检查我的文件是否有错误时,我发现每个文件都有错误.

I'm taking my first crack at creating a very basic WordPress theme. I've got all the template files that I want, and while checking my files for errors, I see that I'm getting an error for every file.

致命错误:调用 blah/blah/blah 中未定义的函数 get_header() ......等

Fatal error: Call to undefined function get_header() in blah/blah/blah.....etc

我看过很多帖子,人们只是简单地说FTP 干净安装"或你这个白痴,你更改了根目录中的 index.php 文件!"答案是否定的,这个函数只在我的主题目录中调用.

I've seen many posts where people simply say "FTP a clean install" or "You moron, you changed the index.php file in the root directory!" The answer is no, this function is called in and only in my theme directory.

非常感谢任何帮助!

谢谢.

推荐答案

通常,当有人错误地将主题中的 index.php 放在 WP 安装文件夹中时会发生这种情况,它会覆盖作为主要 WordPress 文件的 index.php.

Generally this happens when someone has mistakenly put index.php from a theme in the WP install folder, where it overwrites the index.php that is the main WordPress file.

也就是说,位于根目录(即 wp-config.php 所在的目录)中的 index.php 不是可编辑的主题文件.

That is, the index.php that lives in the root directory (thats the directory with the wp-config.php in it) is NOT an editable theme file.

这篇关于WordPress 调用未定义的函数 get_header();的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆