当前位置:网站首页>WordPress obtains category name and link through category ID
WordPress obtains category name and link through category ID
2022-06-21 08:14:00 【Ashi】
stay Wordpress In the process of theme development , In especial CMS Layout of topic classification , Select classification through background options , The foreground calls the classified ID To get the name and link of the category , At this point we will use get_cat_name() and get_category_link() Two functions , And vice versa get_cat_ID() Function to get the classification ID.
get_cat_name() Function usage :
<?php get_cat_name( $cat_id )?>
$cat_id It's all the parameters , For example, get classification ID by 1 The name of :
<?php echo get_cat_name(1);?>
get_category_link() Function usage :
<?php get_category_link( $cat_id )?>
$cat_id It's all the parameters , For example, get classification ID by 1 Link to :
<?php echo get_category_link(1);?>
get_cat_ID() Function usage :
<?php get_cat_ID( $cat_name )?>
$cat_name It's all the parameters , For example, get the category name as ‘Category Name’ Of ID:
<?php echo get_cat_ID('Category Name');?>If no classification is specified ID, There will be problems with the quantity obtained , By designation ID It is more convenient :
<?php echo wt_get_category_count($cat_id ); ?>
Generally, these options are obtained through background options , Output classification ID Just go straight through get_cat_name() and get_category_link() Function to convert to names and links ,
边栏推荐
- Eureka's timedsupersortask class (periodic task with automatic interval adjustment)
- Haidilao is expected to have an annual net loss of 3.8 billion to 4.5 billion and close more than 300 stores
- 2022-2028 global cooling on-off valve industry research and trend analysis report
- 2021-07-28 STM32F103 configuration information
- (对于换行符)gets和fgets的区别,puts和fputs的区别
- (thinking) C. differential sorting
- 一元多项式的乘法与加法运算 (20 分)
- This article takes you to interpret the advertising advantages of tiktok
- 结构体类型的三种声明方式
- [putty] a free SSH and telnet client
猜你喜欢

微信公众号对接 : 一键推送文章信息至公众号

Showctf web primer series

Vision_ Transformer code exercise

Upgrade Jenkins steps and problems encountered

2021-06-16 STM32F103 EXTI 中斷識別 使用固件庫

CTF show WEB10
![[visualization - source code reading] antvis / g-base interpretation - 1](/img/a6/411621e180fa717f98136ddfdbe673.jpg)
[visualization - source code reading] antvis / g-base interpretation - 1

How can we make millions a year now?

How to build a deep learning framework?

图解 Google V8 # 16:V8是怎么通过内联缓存来提升函数执行效率的?
随机推荐
复数四则运算(二十三行简洁代码)
2021-06-17 STM32F103 USART serial port code using firmware library
[yuanuniverse 3D competition]
2021-07-28 STM32F103 I2C Hardware Transfer Include previous IO Clock EXIT USB use firmware library
为什呢代码没报错但是数据库里边的数据显示不出来
Blank screen of virtual machine browser
How to exit quickly if the application is stuck?
Upgrade Jenkins steps and problems encountered
[kotlin] first day
CTF中命令执行知识点总结
Learning Tai Chi maker esp8226 (IX) JSON data communication III
An aunt's towel holds up the 100 billion market behind 400million Chinese women
Blue Bridge Cup: Candy
Solve the problem that Jenkins cannot save the configuration after upgrading
日記(C語言總結)
JVM memory model concepts
Haidilao is expected to have an annual net loss of 3.8 billion to 4.5 billion and close more than 300 stores
Using elastic stack to analyze Olympic data (II)
2022-2028 global hydrogen engine industry research and trend analysis report
PHP类与对象详细介绍