1

我创建了一个简单的 21 岁儿童主题,包含 style.css、functions.php 和 footer.php

functions.php 如下:

<?php
//This adds a custom favicon to the front site of the website
function childtheme_favicon() { ?>
    <link rel="shortcut icon" href="<?php echo 
    bloginfo('stylesheet_directory') ?>/images/favicon.ico">
<?php }
add_action('wp_head', 'childtheme_favicon');

//This is for automatically calculating the copyright years
function comicpress_copyright() {
    global $wpdb;
    $copyright_dates = $wpdb->get_results("SELECT
    YEAR(min(post_date_gmt)) AS firstdate,
    YEAR(max(post_date_gmt)) AS lastdate FROM $wpdb->posts
    WHERE post_status = 'publish' ");

    $output = '';
    if($copyright_dates) {
        $copyright = "© " . $copyright_dates[0]->firstdate;
        if($copyright_dates[0]->firstdate != $copyright_dates[0]->lastdate) {
            $copyright .= '-' . $copyright_dates[0]->lastdate;
        }
        $output = $copyright;
    }
    return $output;
}
?>

footer.php 曾经有一些版权代码,但到目前为止,出于测试原因,它是未经编辑的父主题的精确副本。

WSOD [又名死亡白屏]

所以这就是问题所在。如果我从子主题中删除 footer.php 或 functions.php,该站点将按预期工作!

但是,如果这两个在子主题文件夹中共存,当我尝试注销时,我会得到一个完全空白的屏幕。如果我通过删除 cookie、salt 或其他内容强制注销,我将无法重新登录仪表板,再次出现空白屏幕。尝试了不同的浏览器,结果相同,调试模式处于活动状态,但到目前为止我没有收到任何错误消息。该网站托管在 bluehost 上。

请问有什么想法吗?

4

1 回答 1

0

你只是从父主题复制你的functions.php和footer.php文件吗?或者您是否从一个新文件开始。我知道更多时候不仅仅是简单地复制functions.php文件会给你白屏死机。

于 2013-10-16T13:12:47.997 回答