我试图做出不同的身体类,当我访问某些类别时,它的工作完美,除了当我尝试创建新类别然后访问类别帖子时,它将回显特定类别类别而不是正常的body_class();body_class wordpress加载其他类
这里的代码: 的header.php:
<?php
$catid1 = get_cat_ID('פאודה צפייה ישירה');
$currentcatID = the_category_ID($echo=false);
if(is_single() && $catid1 == $currentcatID){
$catid1 = $catid1;
}else{
$catid1 = $currentcatID;
}
?>
<body <?php
if(!empty($currentcatID)){
if(is_single()){
if($catid1 == $currentcatID){
echo 'class = "rtl single single-post category-'.$catid1.' postid-81 single-format-standard featured-image-only"';
}else{
body_class();
}
}else{
body_class();
}
}
?>>
当我访问网站的索引所有的工作完美,当我访问页面与该类别ID也正在完善,但是当创建新的类别并添加测试后,其回声第一类echo 'class = "rtl single single-post category-'.$catid1.' postid-81 single-format-standard featured-image-only"';
我不想要的,我想回声body_class();
简而言之:我只想在category-1中回显特定的类,否则使用正常的body_class(); 。
任何想法为什么它不工作?