标签: WordPress
-
作者帖子
-
-
2021年6月17日 上午11:32 #20347
-
2021年6月17日 上午11:36 #20348
把主题的inc/functions/functions.php文件的第577行左右的代码贴上来
-
2021年6月17日 上午11:39 #20349
if (!empty($category[0])) {
-
2021年6月17日 上午11:43 #20350
function zib_get_topics_tags($pid = ”, $class = ‘but’, $before = ”, $after = ”, $count = 0)
{
if (!$pid) {
global $post;
$pid = $post->ID;
}
$category = get_the_terms($pid, ‘topics’);
$cat = ”;
if (!empty($category[0])) {
$ii = 0;
foreach ($category as $category1) {
$ii++;
$cls = array(‘c-yellow’, ‘c-green’, ‘c-purple’, ‘c-red’, ‘c-blue’, ‘c-yellow’, ‘c-green’, ‘c-purple’, ‘c-red’, ‘c-blue’, ‘c-yellow’, ‘c-green’, ‘c-purple’, ‘c-red’, ‘c-blue’, ‘c-yellow’, ‘c-green’, ‘c-purple’, ‘c-red’, ‘c-blue’, ‘c-yellow’, ‘c-green’, ‘c-purple’, ‘c-red’, ‘c-blue’, ‘c-yellow’, ‘c-green’, ‘c-purple’, ‘c-red’, ‘c-blue’, ‘c-yellow’, ‘c-green’, ‘c-purple’, ‘c-red’);
$cat .= ‘term_id) . ‘”>’ . $before . $category1->name . $after . ‘‘;
if ($count && $ii == $count) break;
}
}
return $cat;
-
-
2021年6月17日 下午12:01 #20351
577行改成如下:
if ( ! is_wp_error( $category ) && ! empty( $category[0] ) ) {
错误原因是代码没对异常进行处理,属于BUG,有渠道的话可以给开发者反馈下。
-
2021年6月17日 下午12:27 #20352
好的 谢谢!!
-
-
2021年6月17日 下午12:48 #20353
楼主是不是安装了去除分类category的插件?
-
-
作者帖子
- 哎呀,回复话题必需登录。