wp_list_categories 显示没有类别的 wordpress 侧边栏问题 [英] wordpress sidebar issue with wp_list_categories showing NO Categories

查看:27
本文介绍了wp_list_categories 显示没有类别的 wordpress 侧边栏问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以在我的 wordpress 安装上.我试图在侧边栏中显示类别列表,但 wp_list_categories 函数有问题.系统中有少数类别,但此功能仅打印无类别".

So on my wordpress install. I am trying to display category list in the sidebar but having issue with wp_list_categories function. There are handful of categories in the system but this function just prints "NO Categories".

不知道为什么.

有什么想法吗?

推荐答案

  1. 确保您要显示的每个类别中至少有 1 个帖子

  1. Make sure you have at least 1 Post in every category you want to display

wp_list_categories 应该在 wordpress 循环之外.您可能需要在 LOOP 代码之前提供侧边栏代码.

wp_list_categories should be outside of the wordpress LOOP. You'll probably need to provide the sidebar's code before the LOOP's code.

这篇关于wp_list_categories 显示没有类别的 wordpress 侧边栏问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆