2017-08-03 78 views

回答

0

你,如果你想在一個頁面中顯示使用WordPress整齊的功能is_category(),並在那裏你需要給是你的博客的參數,新聞,評論

現在對於例如當從這些類別的職位只需要顯示出來,那麼你必須有這三個類別的ID,你可以從這個

https://developer.wordpress.org/reference/functions/is_category/

申請條件像

if(is_category('1','2','3')){ 
//your codes here 
} 

採取參考

0

創建一個新的自定義類別模板。

1. Inside you theme folder duplicate the category.php file. 
2. Rename the duplicated copy to something like category-news or category-23(whatever you prefer which must match with the category slug or ID respectively). 
3. then change the content of that file. 

每當你導航到該類別(塞=新聞或ID = 23),自動WordPress的尋找相匹配的目標類目頁面類似(類別的news.php或類別的類別模板(塞或ID) -23.php文件)如果文件沒有找到,它會移動到category.php。