2013-03-14 82 views
0

我在我的custom_functions.php中設置了一個自定義循環。循環的基本思路是這樣的顯示重複內容的WordPress自定義循環

function category() { 
    if (is_category(3557)) { 
     News Category content 
    } 
    else{ 
     Main categories content 
    } 
} 

也能正常工作的所有主要類別,但新聞頁面上我展示新聞內容,然後在主網站內容。

+0

你的代碼是斷章取義的,但如果你的「新聞」類別是3557然後在'news'category archive page only that the first part that that should run,not both。我認爲問題在別處。 – 2013-03-14 18:17:17

回答

0

我意識到什麼是錯的 - 我與論文主題的工作,我如何開始一個自定義的循環中發現的例子有

else 
    thesis_loop::category(); 

末。但是,一旦我說實際內容覆蓋默認的循環,我只是需要加入括號內爲else語句,所以就成了

else { 
    Main category content 
}