admin管理员组文章数量:1130349
I have created "Tour Vacation"(tour-vacation) custom taxonomy and added below terms
- Africa (africa)
- Canada (canada)
- Europe (europe)
- US (us)
I want change this terms links.
Current link is: /
I want to change it to: /
So i have done below code.
add_filter( 'term_link', 'change_term_link', 10, 3 );
function change_term_link( $url, $term, $taxonomy ) {
if ( 'tour-vacation' === $taxonomy ) {
$url = home_url() . '/vacation-pacakge/' . $term->slug.'-tour';
}
return $url;
}
The link is changing but it's showing "404 page not found error"
Am i missing anything?
I have created "Tour Vacation"(tour-vacation) custom taxonomy and added below terms
- Africa (africa)
- Canada (canada)
- Europe (europe)
- US (us)
I want change this terms links.
Current link is: /
I want to change it to: /
So i have done below code.
add_filter( 'term_link', 'change_term_link', 10, 3 );
function change_term_link( $url, $term, $taxonomy ) {
if ( 'tour-vacation' === $taxonomy ) {
$url = home_url() . '/vacation-pacakge/' . $term->slug.'-tour';
}
return $url;
}
The link is changing but it's showing "404 page not found error"
Am i missing anything?
本文标签: How to change custom categories term links
版权声明:本文标题:How to change custom categories term links? 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://it.en369.cn/questions/1749141891a2322317.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。


发表评论