2012-09-25 31 views
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上。

有什麼想法嗎?

+0

由於升級到3.4,我也有奇怪的兒童主題問題。如果我有一個functions.php並且只導入TwentyEleven樣式表,那麼搜索框CSS就會全部搞亂。即使我的functions.php沒有任何作用,也會發生這種情況。 –

+1

那麼我刪除了所有的插件,然後重新安裝它們,所有插件都是一個接一個的。問題解決了。只有上帝知道哪一個是有問題的。 – Mpampirina

回答

0

你只是從父主題複製你的functions.php和footer.php文件?或者你開始使用新文件。我知道更多的時候,不僅僅是簡單地複製functions.php文件會給你帶來死亡的白幕。