admin管理员组文章数量:1122832
So my url/slug structure looks like this /toolkit-category/downloads/gui-kits. Within /downloads is other child categories/terms. I am trying to fetch the other siblings of gui-kits when on /gui-kits. "toolkit_category" is the name of my taxonomy that is acting as categories, built using PODS.
$queried_object = get_queried_object('term');
$tax = $queried_object->taxonomy;
$term = $queried_object->term_id;
$parent = $queried_object->parent;
$next_items = get_term_children( $term, $tax );
The above code doesnt work, returns nothing?
Any help is appreciated :)
So my url/slug structure looks like this /toolkit-category/downloads/gui-kits. Within /downloads is other child categories/terms. I am trying to fetch the other siblings of gui-kits when on /gui-kits. "toolkit_category" is the name of my taxonomy that is acting as categories, built using PODS.
$queried_object = get_queried_object('term');
$tax = $queried_object->taxonomy;
$term = $queried_object->term_id;
$parent = $queried_object->parent;
$next_items = get_term_children( $term, $tax );
The above code doesnt work, returns nothing?
Any help is appreciated :)
Share Improve this question asked Oct 4, 2016 at 18:07 dreamsynkdreamsynk 212 bronze badges1 Answer
Reset to default 0Figured it out:
$carousel_items = get_queried_object();
$next_items = get_terms(
$carousel_items->taxonomy,
array('parent' => $carousel_items->parent,)
);
本文标签: phpGet term siblings of current child taxonomy
版权声明:本文标题:php - Get term siblings of current child taxonomy 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736293797a1929220.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论