WordPress根据分类ID获取分类链接标签:get_category_link

作者: 站长 上传时间: 浏览: N/A 下载: N/A 格式: N/A 评分: N/A

WordPress模板标签get_category_link根据传递的分类ID返回相应分类的固定链接,在WordPress主题开发中也常用到。

get_category_link( integer $category )

函数参数

$category

整数型,默认值:none

必须指定一个分类ID,以返回相应分类的链接

函数使用示例

<?php get_category_link( 6 ); ?>

扩展阅读

get_category_link()函数位于:wp-includes/category-template.php

  • the_category()
  • the_category_rss()
  • single_cat_title()
  • category_description()
  • wp_dropdown_categories()
  • wp_list_categories()
  • get_category_parents()
  • get_the_category()
  • in_category()