想要隐藏 WordPress 中的所有类别,但找不到调用 wp_list_categories() 的位置
我想要实现的是暂时隐藏(排除)我的 WordPress 网站上的所有类别。我知道我应该通过添加“排除”来编辑对 wp_list_categories() 的调用。
但是,我似乎找不到调用 wp_list_categories() 的位置。 header.php 中与导航栏相关的唯一语句是:
<div id="catmenucontainer">
<?php wp_nav_menu( array( 'container_id' => 'catmenu', 'theme_location' => 'secondary','fallback_cb'=> 'fallbackmenu2' ) ); ?>
如果您能帮我找到 wp_list_categories(),我将不胜感激
What I want to achieve is to temporary hide (exclude) all the categories on my wordpress site. I know I'm supposed to edit the call to wp_list_categories() by adding "exclude" to it.
However, I can't seem to find where wp_list_categories() is called. The only statement relevant to navigation bar in header.php is:
<div id="catmenucontainer">
<?php wp_nav_menu( array( 'container_id' => 'catmenu', 'theme_location' => 'secondary','fallback_cb'=> 'fallbackmenu2' ) ); ?>
I'd appreciate it if you could help me find wp_list_categories()
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我能够解决我的问题。它比我想象的要简单得多:只需导航到 wp-admin 中的“外观”>“菜单”并从那里删除类别链接!
I was able to solve my issue. It was much simpler than i thought: just navigated to Appearance>Menus in wp-admin and deleted the category links from there!
您能告诉我您的类别具体显示在哪里吗?我的意思是在侧边栏、页眉、页脚等中...
还要检查您的 WordPress 管理部分中的小部件,可能您已将类别作为小部件放置...您可以通过将其删除来直接删除类别从“小部件区域”。
通常 wp_list_categories() 将在当前活动的主题文件中定义,具体取决于我们希望类别显示的位置。
Can u tel me where exactly where are your categories being displayed..? I meant in Sidebar,header,footer, etc....
Also check for the widgets in your Wordpress admin section, may be there you mite have placed the Categories as a widget... You can directly remove the Categories by dropping it out from the "Widget Area".
Usually wp_list_categories() will be defined in the currently active theme files, depending on where we want our categories should be displayed.