您的当前位置:首页 > 知识博客 > wordpress建站

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

时间:2024-03-16

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()


欢迎咨询/Welcome to inquire
tel/vx:18842938855
qq:1685522781
email:1685522781@qq.com

Copyright © 2019-2024 java.fit


Whatsapp
Powered by RRZCMS