2013-01-11 32 views
0

我在我的新主題上使用Ajax滾動器,這就是爲什麼我不得不在我的索引頁面以及wp-blog-header.php頁面中包含一些代碼。一些修改之後,這是我的WP-博客頭PGE的樣子WP已發送Wordpress頭文件

if (!isset($wp_did_header)) { 

$wp_did_header = true; 

require_once(dirname(__FILE__) . '/wp-load.php'); 

wp(); 
require_once(ABSPATH . WPINC . '/template-loader.php'); 
header("HTTP/1.1 200 OK");} 

這段代碼是真正的幫助,並專門救了我的時間最後一行的代碼(標題(「HTTP/1.1 200 OK」);) 。但是,當我使用此代碼它給出頁腳方的錯誤是:

Warning: Cannot modify header information - headers already sent by (output started at /home/xxxx/public_html/xxxx/blog/wp-content/plugins/all-in-one-seo-pack/aioseop.class.php:221) in /home/xxxx/public_html/xxxx/blog/wp-blog-header.php on line 11 

另外,如果我禁用插件它給這個錯誤:

Warning: Cannot modify header information - headers already sent by (output started at /home/xxxx/public_html/xxx/blog/wp-content/themes/z/header.php:5) in /home/xxxx/public_html/xxxx/blog/wp-blog-header.php on line 11 

當我將其刪除或更改其行號的錯誤去但主題不符合預期。

,我用我的主題,這個代碼調用該函數

<?php require('/home/xxx/public_html/xxx/blog/wp-blog-header.php'); ?> 

有沒有什麼辦法來解決這個問題?由於

+0

,什麼是對的'/家庭/ XXXX /的public_html/XXXX /博客/可溼性粉劑博客 - header.php'線11? – cheesemacfly

+0

header(「HTTP/1.1 200 OK」); – Emre

+0

所以它已經發送了你想要的相同頭文件,我錯了嗎? – cheesemacfly

回答

0

我有類似的問題,所有你需要做的是在你的function.php文件的前幾行找到,看看是否有任何評論格式化爲<!--your comment--> OUTSIDE的<?php標籤。這可能會導致問題,因爲我在刪除評論後解決了我的問題,並將function.php文件開頭的註釋移動到<?php標記中,並使用//代替。

我還聽說額外的空間在function.php文件的開頭也可能導致問題