1
我创建了二十十一的一个简单的子主题,用style.css中,一个的functions.php和footer.php黑屏问题与WordPress的二11儿童主题
的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,则该网站按预期工作!
但是,如果这两个文件共存在child-theme文件夹中,当我尝试注销时,会出现完全空白的屏幕。如果我强制通过删除cookie,salt或其他方式注销,我无法重新登录仪表板,再次获得空白屏幕。尝试了不同的浏览器,结果相同,并且调试模式处于活动状态,但到目前为止我没有收到任何错误消息。 该网站托管在bluehost上。
有什么想法吗?
由于升级到3.4,我也有奇怪的儿童主题问题。如果我有一个functions.php并且只导入TwentyEleven样式表,那么搜索框CSS就会全部搞乱。即使我的functions.php没有任何作用,也会发生这种情况。 –
那么我删除了所有的插件,然后重新安装它们,所有插件都是一个接一个的。问题解决了。只有上帝知道哪一个是有问题的。 – Mpampirina