Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/270.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Wordpress传输到子域上的live web服务器仅加载wp_头元素_Php_Wordpress_Header - Fatal编程技术网

Php Wordpress传输到子域上的live web服务器仅加载wp_头元素

Php Wordpress传输到子域上的live web服务器仅加载wp_头元素,php,wordpress,header,Php,Wordpress,Header,我已将本地wordpress站点迁移到live web服务器上的子域,并且只加载了header元素。尽管调试模式设置为true,但我在控制台中没有得到任何输出 我有一个自定义的nav元素,它在头文件的末尾被调用,我已经将get_nav()和wp_nav()函数写入我的general-template.php文件,如下所示: function get_nav( $name = null) { do_action('get_nav', $name); $templates = a

我已将本地wordpress站点迁移到live web服务器上的子域,并且只加载了header元素。尽管调试模式设置为true,但我在控制台中没有得到任何输出

我有一个自定义的nav元素,它在头文件的末尾被调用,我已经将get_nav()和wp_nav()函数写入我的general-template.php文件,如下所示:

function get_nav( $name = null) {

    do_action('get_nav', $name);

    $templates = array();
    $name = (string) $name;
    if ( '' !== $name ) {
        $templates[] = "nav-{$name}.php";
    }

    $templates[] = 'nav.php';

    locate_template( $templates, true );
}

function wp_nav(){
    do_action('wp_nav');
}
my index.php的顶部如下所示:

    <?php get_header(); ?>

       <div class="row justify-content-end icon-post-container">
         <div class="icon-featured-image">
            ....
<!doctype html>
<html <?php language_attributes(); ?>>
<head>
    <meta charset="<?php bloginfo('charset'); ?>">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="profile" href="https://gmpg.org/xfn/11">
    <?php wp_head(); ?>
</head>

<body <?php body_class(); ?>>
<p><?php get_categories(); ?></p>
<div class="container-fluid main-container">
....

....
myheader.php的顶部如下所示:

    <?php get_header(); ?>

       <div class="row justify-content-end icon-post-container">
         <div class="icon-featured-image">
            ....
<!doctype html>
<html <?php language_attributes(); ?>>
<head>
    <meta charset="<?php bloginfo('charset'); ?>">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="profile" href="https://gmpg.org/xfn/11">
    <?php wp_head(); ?>
</head>

<body <?php body_class(); ?>>
<p><?php get_categories(); ?></p>
<div class="container-fluid main-container">
....

已解决:


在推送到实时服务器的过程中,general-template.php文件没有被覆盖。代码没有问题,只是文件的旧版本。

请附上前端加载内容的屏幕截图-出于隐私原因,我无法显示实际页面。有一个默认的wordpress导航加载,但我设置为显示:无;由于我已经创建了自己的导航-这在屏幕快照中不可见。您似乎遗漏了一些php标记或您体内代码中的一些语法,因此它没有显示。如果出现某种语法错误,错误不会打印在页面上吗?我以前遇到过语法问题,它们被打印在发生错误的div/元素中。我不精通PHP,所以我不完全理解代码对这些错误的反应。解释器只是抛出一个错误并停止吗?