在定义列表中显示 WordPress 类别
第一次发帖,长期读者。
我正在将静态 html 文件转换为动态 WordPress 网站。我编写的标记将在定义列表中列出类别,其中 wp 类别名称是
,wp 类别描述是
任何帮助将不胜感激。
谢谢!
约翰
First time poster, long time reader.
I am converting my static html file to a dynamic wordpress site. the markup I wrote will list categories in a definition list where the wp category name is a <dt>
and the wp category description is a <dd>
. My problem is that the wp_list_categories function is not as flexible as I would like, and the extent to which I know php is limited to tweaking built-in functions of wp. What I am looking for is a custom function to accomplish my goal of using a definition list to list wp categories with their category description. Then I can drop that function in the functions.php file and use it throughout the site.
Any help would be much appreciated.
thx!
john
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
get_the_category()
返回与当前帖子相关的所有类别对象的数组。在循环中使用它。编辑:此处使用 http://codex.wordpress.org/Function_Reference/get_the_category
get_the_category()
returns an array of all category objects related to the current post. Use it in the Loop.Edit: Usage here http://codex.wordpress.org/Function_Reference/get_the_category