wordpress - Wordpress - 从侧边栏中隐藏类别
问题描述
我正在为我的网站使用“最近查看的帖子”小部件,显示访问者最近访问的帖子/页面,默认情况下,小部件显示列表中的所有类别帖子,我需要一种方法来隐藏小部件中的帖子类别。
无论如何,这是我的代码。
<?php
function exclude_widget_categories($args){
$exclude = “3,6,18”; // The IDs of the excluding categories
$args[“exclude”] = $exclude;
return $args;
}
add_filter(“widget_categories_args”,”exclude_widget_categories”);
?>
我从这里拿了这个:Wordpress - 排除一个类别出现在菜单或侧边栏小部件中
解决方案
推荐阅读
- node.js - JSON Parse 错误:尝试更改值时发生意外的 EOF
- reactjs - 加载包含 jwt-token 的html
- android - 在 Intent 中设置类型以启动 Activity
- android - 仅编辑edittext android中的特定内容
- redirect - 如何让谷歌搜索显示新域而不是旧域?
- django - 即使所有设置都很好,Django也无法加载静态文件
- java - 需要使用任何java API从给定的数字列表中随机生成每个值相同次数的数字
- java - 使用java的条形图
- laravel - Turbolink 在 Livewire 版本 2 中不工作
- java - 当我执行 mvn package 时,spring-boot-configuration-processor.jar 不会被打包。