WordPress 传输到子域上的实时 Web 服务器,仅加载wp_header元素



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

我有一个自定义 nav 元素,它在标头的末尾调用,我已经将 get_nav(( 和 wp_nav(( 函数写入我的通用模板.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');
}

我的索引顶部.php如下所示:

<?php get_header(); ?>
<div class="row justify-content-end icon-post-container">
<div class="icon-featured-image">
....

我的标题顶部.php看起来像这样:

<!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">
....

在标头.php文件的末尾:

</nav><!-- #site-navigation -->
</header><!-- #masthead -->
<?php get_nav();?>
<div id="content" class="site-content">

所有站点功能都可以在本地主机上运行,并且在实时服务器上加载自定义样式表,引导程序文件和fontawesome JS和CSS似乎没有错误。

这是我第一次使用Wordpress,如果有人可以帮助缩小为什么标题元素是唯一正在加载的PHP文件,我将不胜感激。

已解决:

常规模板.php文件在推送到实时服务器期间未覆盖。代码没有问题,只是文件的旧版本。

最新更新