激活自己的主题后,WordPress的死亡白屏

时间:2018-11-18 12:42:52

标签: php wordpress

我正在尝试为wordpress(和第一个主题)创建新的主题,但遇到的是我的网站没有加载标头或index.php的内容。很奇怪,我已经阅读了WP WSoD文档,但是由于主题只有几行,我看不到任何帮助。

这是我的主题结构: enter image description here

我只编辑了index.phpheader.phpfooter.php。我的functions.php似乎有些东西,但我刚刚添加了几行进行测试,现在又变了空白。

这就是我的header.php内部的内容:

<!DOCTYPE html>
<html lang="es">
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
        <title> <?php bloginfo( 'name' ); ?> </title>

        <!-- Bootstrap CSS -->
        <link rel="stylesheet" href="<?= get_template_directory_uri() ?>/assets/css/bootstrap.min.css">

        <!-- Natural Stylesheet -->
        <link rel="stylesheet" href="<?= get_template_directory_uri() ?>/style.css">

        <!-- Font Awesome -->
        <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.5.0/css/all.css" integrity="sha384-B4dIYHKNBt8Bc12p+WXckhzcICo0wtJAoU8YZTY5qE0Id1GSseTk6S+L3BlXeVIU" crossorigin="anonymous">

        <!-- Favicon -->
        <link rel="shortcut icon" type="image/png" href="<?= get_template_directory_uri(); ?>/assets/img/favicon.png"/>
    </head>
    <body>

这是我的footer.php内部的内容:

        <script type="text/javascript" src="<?= get_template_directory_uri(); ?>/assets/js/jquery-3.3.1.min.js"></script>
        <script type="text/javascript" src="<?= get_template_directory_uri(); ?>/assets/js/popper.js"></script>
        <script type="text/javascript" src="<?= get_template_directory_uri(); ?>/assets/js/bootstrap.min.js"></script>
    </body>
</html>

这就是我的index.php里面的东西:

<?php get_header(); ?>

<?php while( have_posts() ) the_post(); ?>

<?php get_footer(); ?>

1 个答案:

答案 0 :(得分:0)

我编辑了step1,而WordPress正在加载index.php