2010-02-22 33 views
1

我想定製$頭變量在我的page.tpl.php中的模板,因爲也有

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 

出現兩種情況,我相信這是影響網站從使用W3C的標記驗證服務進行驗證。任何幫助將不勝感激,謝謝!

回答

1

那麼,首先我會試着弄清楚爲什麼你會得到重複的。手動刪除一個更像是一個破解而已。

也就是說,您可以使用template_preprocess_page自定義$頭。在你的主題的template.php文件,做這樣的事情:

<?php 
function THEMENAME_preprocess_page(&$variables) { 
    // use $variables['head'] here and do whatever you want with it, such as... 
    $variables['head'] = str_replace('blah blah','blah',$variables['head']); 
    // ...although that's completely untested and might not work 
} 
+0

是的,我試圖找出一個。檢查了我的.info文件和page.tpl.php文件,我沒有看到它可能來自哪裏。我知道那個預處理函數,但正如你所說,我正在試圖找出重複的來源。 – alvincrespo 2010-02-22 21:52:02