!
也想出现在这里? 联系我们
内容广告块

get_term_link()函数-WP常用函数

释放双眼,带上耳机,听听看~!

自定义类型的分类是无法用 <?php echo get_category_link( $category_id ); ?> 输出分类链接地址的,需要用 get_term_link() 函数

语法结构

get_term_link( object|int|string $term, string $taxonomy )

参数

$taxonomy自定义分类的名称

实例

<?php
//根据别名redian获取其对应的分类id
$term=get_term_by('slug','theme','products');
$term_id=$term->term_id;
//根据id获取分类对应链接
$link=get_term_link($term_id,'products');
echo $link;
?>

给TA打赏
共{{data.count}}人
人已打赏
PHP

get_term_by()函数-WP常用函数

2020-12-25 8:54:19

PHP

is_archive()函数-WP常用函数

2020-12-25 8:55:59

版权声明 本站所发布的一切与破解相关的文章仅限用于学习和研究目的,请在下载后的24个小时之内,从您的电脑中彻底删除。所有资源均来自于网络,不得用于商业或者非法用途,否则一切后果请用户自负。如有问题请及时与我联系,QQ:526733428,或提交工单。
0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
购物车
优惠劵
今日签到
有新私信 私信列表
搜索

Warning: error_log(/www/wwwroot/zyansong.com/wp-content/plugins/spider-analyser/#log/log-0319.txt): failed to open stream: No such file or directory in /www/wwwroot/zyansong.com/wp-content/plugins/spider-analyser/spider.class.php on line 2900