2017-08-03 77 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。